Localhost proxy + Chromium DNS overrides for local-dev scans against apps using Auth0 / Firebase / Clerk / Supabase #336
VicenteSotoArmijo
started this conversation in
Ideas
Replies: 1 comment
-
|
I believe this fixes your issue: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When I run Shannon against an app that's running on my dev machine, the auth layer breaks before the pentest even starts:
localhost). Shannon's containerized browser visitinghttp://host.docker.internal:8888triggers the check and the web-app crashes before the login form renders.api.localhost:3000, Chromium hardcodes the.localhostTLD to 127.0.0.1 and never consults/etc/hosts. Inside the worker container that resolves to nothing.The current
host.docker.internalworkaround documented in the README only works for apps without these constraints. For everything else (most modern stacks), the workaround doesn't help.Related: open issue #284 asks for the same kind of in-container DNS routing from a different angle (Traefik reverse-proxy setup).
Proposed solution
An opt-in
networksection in the YAML config that does three things:<local_port>inside the worker container, forward tohost.docker.internal:<remote_port>, rewrite the outgoingHostheader. The browser sees alocalhostorigin (passing the secure-origin check); the dev server sees whatever host header you want (incl. subdomains)..playwright/cli.config.jsoninto a per-workspace overlay that injects--host-resolver-rules=MAP api.localhost 127.0.0.1so.localhostsubdomains route through the proxy instead of Chromium's hardcoded 127.0.0.1.--add-hostplumbing. Pass eachdns_overrideshostname as--add-host <host>:host-gatewayso non-browser tools in the container (curl, fetch, the worker's own HTTP client) resolve them too.Backward-compatible but disabled by default. Config-driven, no Docker image rebuild needed between scans. WebSocket upgrades (Vite HMR, webpack-dev-server) are forwarded transparently.
Example config:
Hardening
Config validation rejects CRLF/NUL in
host_headerandremote_host(HTTP header smuggling), enforces 1-65535 port ranges, and warns whendns_overridespoints to a loopback IP without any proxy mappings (Chromium wouldECONNREFUSED).Implementation status
I have a working branch with:
ProxyManager(HTTP + WebSocket, real-socket tested with Vite HMR)writePlaywrightConfig(per-workspace overlay, doesn't touch user's repo)--add-hostplumbingexample-config.yamlworkflow.log, browser successfully reacheslocalhost:8888, upstream sees the rewritten Host header).The diff is one commit: 26 files, +2674 / -55. No Fintoc-internal references; no formatting churn against
main.Question for maintainers
The README says external PRs aren't being accepted right now. I respect that, so I wanted to raise this here. Have you already thought about implementing something in this line?
Either way, would love to hear your thoughts on the approach.
Beta Was this translation helpful? Give feedback.
All reactions