[PR #7936] [MERGED] fix(server): keep lockdown hints on the safe path (#7914) #8012

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

📋 Pull Request Information

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

Base: staging ← Head: fix/lockdown-hints-7914


📝 Commits (3)

  • 602aa65 fix(server): keep remote lockdown hints on the safe path (#7914)
  • f030ccb fix(server): reword proxied lockdown lede for a single option
  • 79b7f5e test(server): assert proxied lockdown JSON has no allowlist advice

📊 Changes

2 files changed (+37 additions, -38 deletions)

View changed files

📝 packages/server/src/middleware/basic-auth.ts (+22 -27)
📝 scripts/regressions/loopback-proxy-auth-security.regression.ts (+15 -11)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Part of #7914 (parent #7909).

Why this change

Every anonymous remote visitor to an install without a login sees the lockdown page. Today that page, the JSON error and the server log offer the bypass flags (REQUIRE_AUTH_FOR_LOOPBACK_PROXY=false, ALLOW_UNAUTHENTICATED_PRIVATE_NETWORK=true, ALLOW_UNAUTHENTICATED_REMOTE) as fixes. An owner who just wants it to work will pick the shortest one, and that turns protection off. The safe path must be the easy path: these hints now name only setting a login (plus the IP allowlist for direct, non-proxied devices) and link to the docs for everything else.

What changed

  • packages/server/src/middleware/basic-auth.ts:
    • Lockdown page (proxied): removed the "Your proxy already asks for a login" option with REQUIRE_AUTH_FOR_LOOPBACK_PROXY=false; the lede now says to set a login.
    • Lockdown page (direct): removed the ALLOW_UNAUTHENTICATED_PRIVATE_NETWORK=true note; IP allowlist option stays.
    • Both pages get an "Other options" link to docs/REMOTE_ACCESS.md.
    • JSON errors and the one-time log line name only BASIC_AUTH_USER/BASIC_AUTH_PASS (and IP_ALLOWLIST for direct requests) plus the docs link. Log uses Pino format specifiers.
    • No access decision changes.
  • scripts/regressions/loopback-proxy-auth-security.regression.ts: replaced asserts that required the bypass flags in the page; new asserts check page HTML and JSON contain no =false and no ALLOW_UNAUTHENTICATED, do contain BASIC_AUTH_USER, and the proxied page does not offer IP_ALLOWLIST.

The docs still explain the bypass flags with their warnings; doc wording is aligned in a separate #7914 PR.

Validation

  • pnpm check passes locally.

  • loopback-proxy-auth-security passes; 26/27 security regressions pass. multiplayer-peer-server-security fails locally with ERR_TLS_CERT_ALTNAME_INVALID in its own TLS client, the same on a clean tree on this machine (environment, unrelated).

  • Local CodeRabbit could not run: the account hit its review limit. The diff was reviewed by hand instead; GitHub CodeRabbit must still pass before merge.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify: with no login set, open Marinara from another LAN device and check the lockdown page shows the login steps and the IP allowlist option, and no bypass flag.
  • Manually verify: behind a same-host reverse proxy with X-Forwarded-For, the page shows only the login steps.
  • Manually verify the "Other options" link opens docs/REMOTE_ACCESS.md.
  • Manually verify the local browser on the same machine still opens without a password.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Server-rendered lockdown page text only; no client UI change.

Summary by CodeRabbit

  • Security

    • Proxied remote-access lockdown pages now require Basic Authentication and no longer provide IP-allowlist or private-network bypass guidance.
    • Lockdown messages link to the shared remote-access documentation for configuration details.
    • Direct clients retain the IP-allowlist option where applicable.
  • Bug Fixes

    • Improved lockdown messaging consistency across HTML and JSON responses.
    • Added regression coverage to verify that unauthenticated responses do not recommend disabling security checks or bypassing authentication.

🔄 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/7936 **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:** `fix/lockdown-hints-7914` --- ### 📝 Commits (3) - [`602aa65`](https://github.com/Pasta-Devs/Marinara-Engine/commit/602aa6584e5bba7bef247590946c674dcdd50819) fix(server): keep remote lockdown hints on the safe path (#7914) - [`f030ccb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f030ccb642a47828fd4b656a4f2e3409ceca7038) fix(server): reword proxied lockdown lede for a single option - [`79b7f5e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79b7f5ebef9e68847a08e6e7e6be835f56f82016) test(server): assert proxied lockdown JSON has no allowlist advice ### 📊 Changes **2 files changed** (+37 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/middleware/basic-auth.ts` (+22 -27) 📝 `scripts/regressions/loopback-proxy-auth-security.regression.ts` (+15 -11) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Part of #7914 (parent #7909). ## Why this change Every anonymous remote visitor to an install without a login sees the lockdown page. Today that page, the JSON error and the server log offer the bypass flags (`REQUIRE_AUTH_FOR_LOOPBACK_PROXY=false`, `ALLOW_UNAUTHENTICATED_PRIVATE_NETWORK=true`, `ALLOW_UNAUTHENTICATED_REMOTE`) as fixes. An owner who just wants it to work will pick the shortest one, and that turns protection off. The safe path must be the easy path: these hints now name only setting a login (plus the IP allowlist for direct, non-proxied devices) and link to the docs for everything else. ## What changed - `packages/server/src/middleware/basic-auth.ts`: - Lockdown page (proxied): removed the "Your proxy already asks for a login" option with `REQUIRE_AUTH_FOR_LOOPBACK_PROXY=false`; the lede now says to set a login. - Lockdown page (direct): removed the `ALLOW_UNAUTHENTICATED_PRIVATE_NETWORK=true` note; IP allowlist option stays. - Both pages get an "Other options" link to `docs/REMOTE_ACCESS.md`. - JSON errors and the one-time log line name only `BASIC_AUTH_USER`/`BASIC_AUTH_PASS` (and `IP_ALLOWLIST` for direct requests) plus the docs link. Log uses Pino format specifiers. - No access decision changes. - `scripts/regressions/loopback-proxy-auth-security.regression.ts`: replaced asserts that required the bypass flags in the page; new asserts check page HTML and JSON contain no `=false` and no `ALLOW_UNAUTHENTICATED`, do contain `BASIC_AUTH_USER`, and the proxied page does not offer `IP_ALLOWLIST`. The docs still explain the bypass flags with their warnings; doc wording is aligned in a separate #7914 PR. ## Validation - `pnpm check` passes locally. - `loopback-proxy-auth-security` passes; 26/27 `security` regressions pass. `multiplayer-peer-server-security` fails locally with `ERR_TLS_CERT_ALTNAME_INVALID` in its own TLS client, the same on a clean tree on this machine (environment, unrelated). - **Local CodeRabbit could not run**: the account hit its review limit. The diff was reviewed by hand instead; GitHub CodeRabbit must still pass before merge. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify: with no login set, open Marinara from another LAN device and check the lockdown page shows the login steps and the IP allowlist option, and no bypass flag. - Manually verify: behind a same-host reverse proxy with `X-Forwarded-For`, the page shows only the login steps. - Manually verify the "Other options" link opens `docs/REMOTE_ACCESS.md`. - Manually verify the local browser on the same machine still opens without a password. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Server-rendered lockdown page text only; no client UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **Security** - Proxied remote-access lockdown pages now require Basic Authentication and no longer provide IP-allowlist or private-network bypass guidance. - Lockdown messages link to the shared remote-access documentation for configuration details. - Direct clients retain the IP-allowlist option where applicable. - **Bug Fixes** - Improved lockdown messaging consistency across HTML and JSON responses. - Added regression coverage to verify that unauthenticated responses do not recommend disabling security checks or bypassing authentication. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:39 +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#8012
No description provided.