Repository navigation
Reject CR/LF/NUL in header values in the pycurl HTTP client - #1971
Open
jar-stripe wants to merge 1 commit into
Open
jar-stripe wants to merge 1 commit into
jar-stripe wants to merge 1 commit into
Conversation
PycurlClient built the HTTPHEADER list via raw "%s: %s" string interpolation with no validation, so a header value containing CR or LF could inject an additional header line (e.g. via Stripe-Request- Trigger, built from an unverified webhook event id). Other HTTP client backends in this file are already protected by their own underlying library (stdlib http.client, h11, aiohttp); pycurl has no such check built in, so it needs one here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Committed-By-Agent: claude
jar-stripe
marked this pull request as ready for review
November 7, 2026 05:15
jar-stripe
enabled auto-merge (squash)
November 7, 2026 05:43
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
RUN_DEVSDK-3683: PycurlClient builds its HTTPHEADER list by string-interpolating header names and values with no validation. A header value containing CR or LF can inject an additional header line — concretely reachable via Stripe-Request-Trigger, which is built from an unverified webhook event id. Every other HTTP client backend in this file already rejects this via its own underlying library (stdlib http.client, h11, aiohttp); pycurl has no such check built in.
What?
See Also
RUN_DEVSDK-3697 tracks adding equivalent hardening tests across the rest of this file's HTTP client backends and the other 6 SDK languages.
Configuration
skip-changefile: This PR is not a user-facing change, so there's no changefile.