TLS-intercepting egress proxy duplicates `Content-Length` – malforming HTTP requests, causing "400 Bad Request" errors
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- networking
Research direction
First confirm whether gh-aw-firewall or padawan-fw owns the outbound HTTPS request handling, then locate the proxy path that writes request headers. Reproduce the captured POST with differently cased Content-Length headers against a strict HTTP server. Done means the proxy preserves a single case-insensitive Content-Length header and the request is accepted without a 400 response.
Written by the indexing model from the issue text.
Description
We hit this issue with the GitHub Copilot cloud agent firewall. Opening here, but this bug might actually be in padawan-fw instead. I can't find a public issue tracker for padawan-fw, so if this issue belongs there, I'd really appreciate if you could copy it along! Thank you.
The bug
When the "Enable firewall" setting is on, outgoing requests from the Copilot cloud agent environment are MITM'd. This behaviour is undocumented, but it's independently verifiable by inspecting the TLS certificate the environment is served: for any allowlisted HTTPS host, the presented cert is issued by a per-runner mkcert CA (issuer mkcert development CA … runner@runnervm…) rather than the site's real CA.
In other words, the proxy has terminated and re-signed the connection. The same host serves its genuine public certificate (e.g. GoDaddy… for BrowserStack) both from outside the sandbox and, tellingly, from inside the moment the firewall is switched off.
For the most part, this MITM/firewall operates transparently. However, the MITM notably malforms HTTP requests by duplicating the Content-Length header. Strict HTTP servers reject these malformed requests with a 400 Bad Request per RFC 7230 §3.3.2.
The following is a HTTP request that was captured on a HTTPS endpoint that I control:
POST /… HTTP/1.1
Host: …
User-Agent: undici
Content-Length: 47 <- injected by the proxy (canonical casing)
accept: */*
content-length: 47 <- client's original (lowercase) — the DUPLICATE
content-type: application/json
What seems to be happening – the original request had content-length, but the proxy added Content-Length – ignoring the valid content-length header. This looks like a case sensitivity issue in whichever part of the agent firewall code is responsible for writing outgoing requests.
- Dominant language
- TypeScript
- Stars
- 149
- Forks
- 77
- Avg merge
- 4h 20m
- Merged PRs (30d)
- 436
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-aw-firewall
-
agentic-workflows automated dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/gh-aw-firewall#3837 ·
Maintainers usually reply within 1 day
-
agentic-workflows
Difficulty 4/5 1-2 days Newbie friendliness 35/100
github/gh-aw-firewall#10315 ·
Maintainers usually reply within 1 day
-
Router: port the routing core and CLI to Go (built and tested, not shipped)Possibly taken @rabeckett claimed this today. Openenhancement refactoring
Difficulty 5/5 Over a week Newbie friendliness 1/100
github/gh-aw-firewall#10312 ·
Maintainers usually reply within 1 day
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
github/gh-aw-firewall#10309 ·
Maintainers usually reply within 1 day
-
agentic-workflows
Difficulty 3/5 1-2 days Newbie friendliness 35/100
github/gh-aw-firewall#10308 ·
Maintainers usually reply within 1 day
All issues in github/gh-aw-firewall
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simkimsia/netlify-axi#19 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
subhranshudash13-dotcom/Contribo#74 ·
Maintainers usually reply within 1 day
-
enhancement frontend good first issue Stellar Wave trivial
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Godgift-care/sci-healthcare-frontend#166 · 1 comment ·
Maintainers usually reply within 1 day
-
backend good first issue security Stellar Wave trivial
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Godgift-care/sci-healthcare-backend#171 · 1 comment ·
Maintainers usually reply within 1 day