Repository navigation
serve: no open proxy by accident – --serve-host needs a password or --serve-open - #328
Merged
Merged
Conversation
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
--serve --serve-host 0.0.0.0without a password started an open proxy – only a warning was printed. Docker publishes ports on all interfaces and bypasses host firewalls such as ufw, sodocker 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
open_server_refusal(opts)inapp.py: non-loopbackserve_host+ no password + no--serve-open→ refused.cli.runchecks it before the scan and exits with code 2 and an actionable message;Run.servechecks again (defense in depth for programmatic use).--serve-open(round-trips throughto_argv, so saved wizard settings keep it); the warning stays when it is used.Compatibility
Intentional behavior change for one setup: password-less non-loopback servers now need
--serve-open.compose.yamlalready 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.servenever 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.