mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-25 16:42:16 +03:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user