[PR #7988] [MERGED] feat(server): report a broad IP_ALLOWLIST as open to the internet (#7911) #8041

Closed
opened 2026-10-24 04:09:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7988
Author: @Gunterlie
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Gunterlie

Base: staging ← Head: feat/broad-allowlist-warning


📝 Commits (3)

  • c62d87c feat(server): report a broad IP allowlist as open to the internet (#7911)
  • 5f716b5 fix(server): reject IPv4 allowlist prefixes above /32 (#7911)
  • 1039360 fix(server): report IPv6 allowlist entries that cover all IPv4 as broad (#7911)

📊 Changes

3 files changed (+39 additions, -1 deletions)

View changed files

📝 packages/server/src/middleware/ip-allowlist.ts (+24 -1)
📝 scripts/regressions/access-policy.regression.ts (+5 -0)
📝 scripts/regressions/access-status.regression.ts (+10 -0)

📄 Description

Part of #7911 (parent #7909).

Why

The access status warning (#7955) reports an IP_ALLOWLIST as a deliberate choice and stays quiet. But an entry such as 0.0.0.0/0, ::/0 or a public /8 lets in whole ISPs or the whole internet without a password. You should see that as the critical "open to the internet" warning, not as a normal allowlist.

What changed

  • ip-allowlist.ts: an allowlist entry counts as broad when its prefix is shorter than /16 (IPv4) or /32 (IPv6) and it is not inside the private, CGNAT or loopback ranges. When a direct (not proxied) allowlist has such an entry, getPasswordlessPeers also reports internet, next to allowlist.
  • No change to who is let in. Enforcement in access-policy.ts and the request hooks is unchanged.
  • No UI or copy change: the client already shows internet as critical.
  • Regression: 0.0.0.0/0 and ::/0 report internet + allowlist; 10.0.0.0/8, 203.0.113.0/24 and 100.64.0.0/10 report allowlist only.

Manual verification

  • Set IP_ALLOWLIST=0.0.0.0/0, open Marinara on the host and confirm the critical "open to the internet" banner shows.
  • Set IP_ALLOWLIST=192.168.1.0/24 and confirm only the normal allowlist status shows.

Local checks: pnpm check, pnpm localization:check, access regressions pass. Local CodeRabbit could not run (rate limit); the GitHub CodeRabbit review covers it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7988 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/broad-allowlist-warning` --- ### 📝 Commits (3) - [`c62d87c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c62d87cf24f7dc0545664d8829bfd7809f40e503) feat(server): report a broad IP allowlist as open to the internet (#7911) - [`5f716b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5f716b553e98a1f51facc169114aba8867bc384f) fix(server): reject IPv4 allowlist prefixes above /32 (#7911) - [`1039360`](https://github.com/Pasta-Devs/Marinara-Engine/commit/103936010cde894eb2ea4ba9d1e4d24139cfbc9d) fix(server): report IPv6 allowlist entries that cover all IPv4 as broad (#7911) ### 📊 Changes **3 files changed** (+39 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/middleware/ip-allowlist.ts` (+24 -1) 📝 `scripts/regressions/access-policy.regression.ts` (+5 -0) 📝 `scripts/regressions/access-status.regression.ts` (+10 -0) </details> ### 📄 Description Part of #7911 (parent #7909). ## Why The access status warning (#7955) reports an `IP_ALLOWLIST` as a deliberate choice and stays quiet. But an entry such as `0.0.0.0/0`, `::/0` or a public `/8` lets in whole ISPs or the whole internet without a password. You should see that as the critical "open to the internet" warning, not as a normal allowlist. ## What changed - `ip-allowlist.ts`: an allowlist entry counts as broad when its prefix is shorter than `/16` (IPv4) or `/32` (IPv6) and it is not inside the private, CGNAT or loopback ranges. When a direct (not proxied) allowlist has such an entry, `getPasswordlessPeers` also reports `internet`, next to `allowlist`. - No change to who is let in. Enforcement in `access-policy.ts` and the request hooks is unchanged. - No UI or copy change: the client already shows `internet` as critical. - Regression: `0.0.0.0/0` and `::/0` report `internet` + `allowlist`; `10.0.0.0/8`, `203.0.113.0/24` and `100.64.0.0/10` report `allowlist` only. ## Manual verification - [ ] Set `IP_ALLOWLIST=0.0.0.0/0`, open Marinara on the host and confirm the critical "open to the internet" banner shows. - [ ] Set `IP_ALLOWLIST=192.168.1.0/24` and confirm only the normal allowlist status shows. Local checks: `pnpm check`, `pnpm localization:check`, access regressions pass. Local CodeRabbit could not run (rate limit); the GitHub CodeRabbit review covers it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8041
No description provided.