Skip to content

Harden CONNECT header handling against injection and spoofing - #24

Merged
proxymesh merged 2 commits into
mainfrom
cursor/vulnerability-findings-memory-4cec
Sep 1, 2026
Merged

Harden CONNECT header handling against injection and spoofing#24
proxymesh merged 2 commits into
mainfrom
cursor/vulnerability-findings-memory-4cec

Conversation

@cursor

@cursor cursor Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Reject CR/LF/NUL in outbound proxy CONNECT headers, and stop copying arbitrary CONNECT response headers onto origin HTTPS responses.

Outbound: proxy_headers names and values are validated before they are written into CONNECT (urllib3/requests/cloudscraper/autoscraper and pycurl). httpx and aiohttp already rejected control characters.

Inbound: Only X-ProxyMesh-* CONNECT headers are merged into response.headers, and they never overwrite an origin header. Sensitive headers such as Set-Cookie, Location, and Content-Type are not copied. The full CONNECT set is available on response.proxy_headers.

Adds test_header_security.py and a CI unit-test job that does not need PROXY_URL.

Open in Web View Automation 

Reject CR/LF/NUL in outbound proxy CONNECT headers and copy only
X-ProxyMesh-* CONNECT response headers onto origin responses without
overwriting existing origin values.

Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
@proxymesh
proxymesh marked this pull request as ready for review September 1, 2026 17:22
@cursor
cursor Bot requested a review from proxymesh September 1, 2026 17:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment and assigned a reviewer. This is not a Dependabot version bump, so it is outside the auto-approval policy and needs human review. Cursor Bugbot and Cursor Security Agent checks were not present.

Open in Web View Automation 

Sent by Cursor Approval Agent: dependabot approver

Drop the ProxyMesh-only allowlist. Copy any CONNECT response header
that is not hop-by-hop or security-sensitive, and never overwrite
origin values. Pin GitHub Actions to commit SHAs.

Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>
@proxymesh
proxymesh merged commit fac07a7 into main Sep 1, 2026
3 checks passed
@proxymesh
proxymesh deleted the cursor/vulnerability-findings-memory-4cec branch September 1, 2026 17:34
@cursor cursor Bot mentioned this pull request Sep 1, 2026
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.

1 participant