Skip to content

Fix pycurl file:// fetches and origin-header CRLF injection - #36

Merged
proxymesh merged 1 commit into
mainfrom
fix/pycurl-url-scheme-and-header-injection
Nov 2, 2026
Merged

proxymesh merged 1 commit into
mainfrom
fix/pycurl-url-scheme-and-header-injection

Conversation

@cursor

@cursor cursor Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Restricts the high-level pycurl helper so it cannot fetch non-HTTP URLs or smuggle extra request lines.

python_proxy_headers.pycurl_proxy.request() / get() previously passed caller URLs and origin headers straight to libcurl. That allowed file:// local-file reads (even when a proxy was set) and CR/LF in origin headers or the HTTP method.

Changes

  • Reject non-http/https URLs and control characters in validate_http_url()
  • Pin libcurl PROTOCOLS / REDIR_PROTOCOLS to HTTP(S)
  • Validate origin headers with validate_headers() and methods with validate_http_method() before setopt
  • Unit tests for file://, dict://, origin-header CRLF, and method CRLF

Low-level set_proxy_headers() / raw pycurl usage is unchanged.

Open in Web View Automation 

Block file:// and other non-HTTP schemes in pycurl_proxy.request(), pin
libcurl protocols to HTTP(S), and validate origin headers and methods so
CR/LF cannot smuggle extra request lines.

Co-authored-by: ProxyMesh AI <proxymeshai@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

bugbot review

@cursor

cursor Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@cursor

cursor Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Review: no issues found.

Checked the high-level pycurl changes for non-HTTP scheme bypasses (including file://), CR/LF request smuggling in the URL, method, and origin headers, libcurl protocol pinning, proxy-URL file reads, and proxy credential leakage. Scheme and header checks reject those cases, CURLOPT_PROTOCOLS still blocks file:// if a URL reaches libcurl, and redirects are not followed. This diff does not change workflow permissions.

No code changes. PR left as a draft.

@proxymeshai
proxymeshai marked this pull request as ready for review November 1, 2026 21:08
@proxymesh
proxymesh merged commit 3855c41 into main Nov 2, 2026
3 checks passed
@proxymesh
proxymesh deleted the fix/pycurl-url-scheme-and-header-injection branch November 2, 2026 22:10
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