Skip to content

Harden HTTP proxy header handling#440

Merged
TsuyoshiUshio merged 4 commits into
v4.xfrom
fix/msrc-http-proxy-user-header-handling
May 26, 2026
Merged

Harden HTTP proxy header handling#440
TsuyoshiUshio merged 4 commits into
v4.xfrom
fix/msrc-http-proxy-user-header-handling

Conversation

@TsuyoshiUshio
Copy link
Copy Markdown
Contributor

Summary

  • block hop-by-hop and framing response headers from the HTTP proxy response path
  • handle invalid x-ms-client-principal payloads without failing the invocation
  • add focused tests for proxy header filtering and invalid client principal JSON

Notes

F4 (ensureErrorType object serialization) is intentionally not changed in this PR. That area needs a separate design discussion because the safer fix likely requires sanitizer behavior aligned with azure-functions-host and azure-functions-nodejs-worker, not just using an object's message property.

Validation

  • npm test (375 passed)
  • npm run lint

Block hop-by-hop response headers from being forwarded through the HTTP proxy and handle invalid x-ms-client-principal payloads without failing the invocation.

Co-authored-by: Dobby <dobby@microsoft.com>
@TsuyoshiUshio TsuyoshiUshio requested a review from a team as a code owner May 19, 2026 20:39
Comment thread src/http/extractHttpUserFromHeaders.ts
Comment thread src/http/httpProxy.ts
Allow Content-Length through the HTTP proxy while continuing to block hop-by-hop headers. Also strip response headers named by the Connection header so connection-specific fields do not cross the proxy boundary.

Co-authored-by: Dobby <dobby@microsoft.com>
@TsuyoshiUshio TsuyoshiUshio merged commit b46b57c into v4.x May 26, 2026
15 checks passed
@TsuyoshiUshio TsuyoshiUshio deleted the fix/msrc-http-proxy-user-header-handling branch May 26, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants