[GH-ISSUE #723] [Issue]: Docker reverse proxy traffic can inherit Docker bridge trust #345

Closed
opened 2026-10-20 17:27:52 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @NeoKazuya on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/723

Summary

When Marinara is behind a Docker reverse-proxy container, the proxy's Docker bridge IP triggers the Docker auth bypass before Basic Auth runs, so clients reaching Marinara through the proxy can skip the password check the operator configured.

Expected behavior

Users should be able to keep passwordless trusted Docker container traffic, while also having a way to make Marinara-side Basic Auth/IP allowlist apply to Docker reverse-proxy traffic.

Actual behavior

Docker bridge peers are treated as trusted before Basic Auth/IP allowlist checks. When the peer is a reverse proxy container, clients behind that proxy can inherit the proxy container's trusted source IP unless the proxy enforces auth itself or Docker bypass is disabled.

Steps to reproduce

  1. Run Marinara in Docker or on a host reachable from a Docker bridge network.
  2. Run Caddy, nginx, Traefik, a tunnel connector, or another reverse proxy in Docker.
  3. Configure the proxy to forward browser requests to Marinara.
  4. Configure BASIC_AUTH_USER and BASIC_AUTH_PASS in Marinara.
  5. Leave BYPASS_AUTH_DOCKER at its default enabled state.
  6. Send a request through the proxy. Marinara sees the proxy container's Docker bridge IP, such as 172.17.x.x, and applies Docker bypass before Basic Auth.

In that setup, the outer client does not need to be on the Docker network. They only need to reach the proxy endpoint.

Environment

  • Marinara Engine version: main at 1b65a201986845b817accce455c663ebf9a375f8 before this patch
  • Install type: Docker / Docker reverse proxy pattern; manual repro used separate server and client/proxy containers on one Docker bridge
  • OS + version: Windows 11 Pro 10.0.26200 host with Docker Desktop 28.5.1
  • Browser or app shell: not browser-specific; reproduced with a Docker client container sending an HTTP request with X-Forwarded-For. A browser behind Caddy/nginx/Traefik/Cloudflare Tunnel would hit the same server-side path.

Additional context

This is not asking to remove the existing Docker bridge bypass. The goal is to handle the reverse-proxy case when Marinara, not the proxy, is intended to enforce auth.

Suggested approach: add documentation and a targeted mode for Docker proxy traffic. In that mode, Docker bridge traffic carrying forwarding headers such as X-Forwarded-For, Forwarded, or X-Real-IP would not receive the Docker auth bypass.

This preserves existing default behavior while giving proxy/tunnel users a targeted control.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @NeoKazuya on GitHub (May 12, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/723 ## Summary When Marinara is behind a Docker reverse-proxy container, the proxy's Docker bridge IP triggers the Docker auth bypass before Basic Auth runs, so clients reaching Marinara through the proxy can skip the password check the operator configured. ## Expected behavior Users should be able to keep passwordless trusted Docker container traffic, while also having a way to make Marinara-side Basic Auth/IP allowlist apply to Docker reverse-proxy traffic. ## Actual behavior Docker bridge peers are treated as trusted before Basic Auth/IP allowlist checks. When the peer is a reverse proxy container, clients behind that proxy can inherit the proxy container's trusted source IP unless the proxy enforces auth itself or Docker bypass is disabled. ## Steps to reproduce 1. Run Marinara in Docker or on a host reachable from a Docker bridge network. 2. Run Caddy, nginx, Traefik, a tunnel connector, or another reverse proxy in Docker. 3. Configure the proxy to forward browser requests to Marinara. 4. Configure `BASIC_AUTH_USER` and `BASIC_AUTH_PASS` in Marinara. 5. Leave `BYPASS_AUTH_DOCKER` at its default enabled state. 6. Send a request through the proxy. Marinara sees the proxy container's Docker bridge IP, such as `172.17.x.x`, and applies Docker bypass before Basic Auth. In that setup, the outer client does not need to be on the Docker network. They only need to reach the proxy endpoint. ## Environment - Marinara Engine version: `main` at `1b65a201986845b817accce455c663ebf9a375f8` before this patch - Install type: Docker / Docker reverse proxy pattern; manual repro used separate server and client/proxy containers on one Docker bridge - OS + version: Windows 11 Pro `10.0.26200` host with Docker Desktop `28.5.1` - Browser or app shell: not browser-specific; reproduced with a Docker client container sending an HTTP request with `X-Forwarded-For`. A browser behind Caddy/nginx/Traefik/Cloudflare Tunnel would hit the same server-side path. ## Additional context This is not asking to remove the existing Docker bridge bypass. The goal is to handle the reverse-proxy case when Marinara, not the proxy, is intended to enforce auth. Suggested approach: add documentation and a targeted mode for Docker proxy traffic. In that mode, Docker bridge traffic carrying forwarding headers such as `X-Forwarded-For`, `Forwarded`, or `X-Real-IP` would not receive the Docker auth bypass. This preserves existing default behavior while giving proxy/tunnel users a targeted control. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:27:52 +07:00
  • closed this issue
  • added the
    bug
    label
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#345
No description provided.