mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8013
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7938
Author: @Gunterlie
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/proxy-trust-7914📝 Commits (4)
5784418fix(server): treat HTTP/1.0 and relayed-Host requests as proxied for Docker and Tailscale trust (#7914)7648c5bdocs: describe HTTP/1.0 proxy detection and proxy trust rules (#7914)05db5a7fix(server): end Tailscale trust for forwarded peers with no opt-out (#7914)4f11fc9docs: address review of proxy trust docs (#7914)📊 Changes
11 files changed (+165 additions, -47 deletions)
View changed files
📝
.env.example(+9 -4)📝
README.md(+1 -1)📝
docs/CONFIGURATION.md(+18 -18)📝
docs/FAQ.md(+1 -1)📝
docs/REMOTE_ACCESS.md(+19 -6)📝
docs/TROUBLESHOOTING.md(+2 -2)📝
packages/server/src/middleware/access-policy.ts(+12 -9)📝
packages/server/src/middleware/ip-allowlist.ts(+11 -4)📝
scripts/regressions/access-policy.regression.ts(+40 -0)📝
scripts/regressions/docker-gateway-auth-security.regression.ts(+8 -2)📝
scripts/regressions/loopback-proxy-auth-security.regression.ts(+44 -0)📄 Description
Linked issue
Part of #7914 (parent #7909).
Why this change
The #7914 audit found same-host and container proxy setups that still give public or LAN visitors access without a login — the same kind of setup that let unsecured installs get indexed by search engines:
proxy_pass http://127.0.0.1:7860sendsHost: 127.0.0.1:7860, no forwarding headers, and HTTP/1.0. The server saw a local browser.127.0.0.1publish): Docker gateway trust ended only on forwarding headers, not on a relayed Host.100.xaddress: public visitors arrived as a trusted Tailscale peer.Local use must stay passwordless, so each rule only targets traffic that a proxy relayed.
What changed
packages/server/src/middleware/access-policy.ts,ip-allowlist.ts(built on the shared policy from #7934):http10fact. A loopback request over HTTP/1.0 counts as proxied (browsers, Nodehttp, undici and Android WebView all send HTTP/1.1; default nginxproxy_passsends 1.0).localhost/127.0.0.1) stays passwordless.100.x:7860stays passwordless./api/healthstays reachable through an HTTP/1.0 proxy.http://marinara:7860(or through the gateway with a non-local Host) now needs a login. No file in this repo does that.loopback-proxy-auth-security: table run through the real hooks — local browser onlocalhost,::1,::ffff:127.0.0.1(200); nginx HTTP/1.0, nginx withX-Forwarded-For, nginx over::1, cloudflared, Tailscale Serve/Funnel, ngrok, LAN client fakingX-Forwarded-For(401);/api/healthvia HTTP/1.0 proxy (200). The HTTP/1.0 case uses a test-only hook in the regression file; production reads onlyrequest.raw.httpVersion.access-policy: HTTP/1.0 loopback, Docker gateway with relayed Host / HTTP/1.0, forwarded vs direct Tailscale peer, andREQUIRE_AUTH_FOR_DOCKER_PROXY=falsenot restoring Tailscale trust.docker-gateway-auth-security: expectations changed on purpose — gateway requests now use Host127.0.0.1for the trusted case, and a gateway request with a LAN Host is not trusted.docs/REMOTE_ACCESS.md,CONFIGURATION.md,TROUBLESHOOTING.md,FAQ.md,README.md,.env.example):X-Forwarded-Forline stays recommended).REQUIRE_AUTH_FOR_LOOPBACK_PROXY=false/REQUIRE_AUTH_FOR_DOCKER_PROXY=false: only when the proxy itself requires a login from every visitor. For a local/etc/hostsname, recommend a*.localhostname instead of the global flag.127.0.0.1publish and set a login before adding a proxy.ALLOW_UNAUTHENTICATED_PRIVATE_NETWORKincludes100.64.0.0/10, which some providers give to customers.Gaps that stay open: an HTTP/1.1 proxy that strips forwarding headers and rewrites Host to
localhost, and a default nginx on another tailnet node. Both look exactly like a local browser or a direct Tailscale peer.Validation
pnpm checkpasses locally.access-policy,loopback-proxy-auth-security,docker-gateway-auth-security,docker-proxy-authpass locally. In an earlierregression:securityrun, 26/27 passed;multiplayer-peer-server-securityfails on this machine withERR_TLS_CERT_ALTNAME_INVALIDin its own TLS client (does not import these files).Opus adversarial review: no local lockout found (Vite dev proxy, launcher health checks,
::1, Android WebView checked); its doc and test findings are fixed.Local CodeRabbit could not run: the account hit its review limit. GitHub CodeRabbit must pass before merge.
pnpm checkpasses locallyContainer (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.mdManual verification notes
http://localhost:7860andhttp://127.0.0.1:7860on the same computer still open without a password (native and Docker).proxy_pass http://127.0.0.1:7860shows the lockdown page / asks for a login.tailscale serve/tailscale funnelvisitors are asked for a login, and direct100.x:7860access is not.pnpm dev(Vite proxy) on the same computer stays passwordless.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs-i18n follow-up needed for
docs/REMOTE_ACCESS.md,docs/CONFIGURATION.md,docs/TROUBLESHOOTING.md,docs/FAQ.mdafter merge.UI evidence (if applicable)
Server and docs only; no UI change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.