Skip to content

serve: no open proxy by accident – --serve-host needs a password or --serve-open - #328

Merged
maximilianfeix merged 1 commit into
mainfrom
fix/serve-open-requires-opt-in
Oct 14, 2026
Merged

maximilianfeix merged 1 commit into
mainfrom
fix/serve-open-requires-opt-in

Conversation

@maximilianfeix

Copy link
Copy Markdown
Owner

Problem

--serve --serve-host 0.0.0.0 without a password started an open proxy – only a warning was printed. Docker publishes ports on all interfaces and bypasses host firewalls such as ufw, so docker run -p 8899:8899 IMAGE --recheck --serve --serve-host 0.0.0.0 (one character away from the README's -p 127.0.0.1:8899:8899) relayed traffic for anyone on the internet.

Change

  • New open_server_refusal(opts) in app.py: non-loopback serve_host + no password + no --serve-open → refused.
  • cli.run checks it before the scan and exits with code 2 and an actionable message; Run.serve checks again (defense in depth for programmatic use).
  • New flag --serve-open (round-trips through to_argv, so saved wizard settings keep it); the warning stays when it is used.
  • README (EN/ES) and option tables updated; CHANGELOG under Security.

Compatibility

Intentional behavior change for one setup: password-less non-loopback servers now need --serve-open. compose.yaml already sets a password and is unaffected. Loopback (127.0.0.1, ::1, localhost) is unchanged.

Tests

tests/test_serve_open.py (14 tests): refused hosts (IPv4, IPv6 ::, LAN IP, hostname), allowed combinations, env-var password, argv round-trip, CLI exits 2 without starting the scan, Run.serve never listens. Verified that 6 of them fail with the check disabled. Full suite locally: 1087 passed, ruff clean. Manual: proxy-scraper --recheck --serve --serve-host 0.0.0.0 → message, exit 2.

…-serve-open

On any address but loopback without a password the rotating server was an open
proxy, with only a warning. Docker publishes ports on every interface and past
host firewalls like ufw, so 'docker run -p 8899:8899 … --serve-host 0.0.0.0'
served anyone on the internet.

Now the CLI refuses before the scan (exit code 2) and says what to set:
PROXY_SCRAPER_SERVE_PASSWORD, or --serve-open as the deliberate opt-in when a
firewall or -p 127.0.0.1:… already keeps others out. Run.serve refuses as well,
for Run used on its own. compose.yaml already sets a password.
@maximilianfeix
maximilianfeix merged commit ede5fe6 into main Oct 14, 2026
21 checks passed
@maximilianfeix
maximilianfeix deleted the fix/serve-open-requires-opt-in branch October 14, 2026 18:26
@maximilianfeix maximilianfeix mentioned this pull request Oct 14, 2026
maximilianfeix added a commit that referenced this pull request Oct 14, 2026
Security: the rotating server refuses to run as an open proxy (--serve-host
off loopback needs a password or --serve-open, #328); hash-enforced CI
installs, digest-pinned base image, checked mcp-publisher (#329).
Adds docs/MAINTENANCE.md, the maintenance log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant