Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TLS-intercepting egress proxy duplicates `Content-Length` – malforming HTTP requests, causing "400 Bad Request" errors

Closed
#6,222 0 comments 0 reactions 0 assignees View on GitHub

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.

Image

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/gh-aw-firewall

All issues in github/gh-aw-firewall

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.