fix(security): refuse proxy-authorization and proxy-authenticate upstream (#11328)

Validated on a 17-PR combined board: upstream-headers-proxy-auth within the board's 287/287, typecheck:core clean, gates within baseline. proxy-authorization and proxy-authenticate join the FORBIDDEN denylist — forwarding proxy-authorization to a model provider would hand that provider the operator's own proxy credential. Thank you @ntdat812!
This commit is contained in:
Nguyen Thanh Dat
2026-08-24 11:49:37 +07:00
committed by GitHub
parent c3698eedcb
commit 8d6f91b558
3 changed files with 77 additions and 0 deletions

View File

@@ -10,6 +10,16 @@ const FORBIDDEN = new Set(
"content-length",
"keep-alive",
"proxy-connection",
// The two RFC 7230 §6.1 hop-by-hop names this list was missing. They belong
// to the connection between the client and OmniRoute (or its upstream
// proxy), never to the request OmniRoute makes to the model provider —
// forwarding `proxy-authorization` hands that proxy credential to the
// provider. `src/lib/services/reverseProxy.ts` (HOP_BY_HOP),
// `src/mitm/sanitizeHeaders.ts`, `src/mitm/inspector/httpProxyServer.ts`,
// `src/mitm/tproxy/tlsCapture.ts` and `src/app/api/openapi/try/route.ts`
// all already strip them; this list, the canonical one, did not.
"proxy-authenticate",
"proxy-authorization",
"transfer-encoding",
"te",
"trailer",