Repository navigation
Escape OAuthError messages in examples/oauth.py - #1970
Closed
jar-stripe wants to merge 3 commits into
Closed
jar-stripe wants to merge 3 commits into
jar-stripe wants to merge 3 commits into
Conversation
Flask returns a plain string from a view function as text/html with no escaping, so the OAuthError message echoed back in both the /oauth/callback and /deauthorize routes was reflected into the response unescaped. Escape it with markupsafe.escape() before including it in the response body. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Committed-By-Agent: claude
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 04:53
jar-stripe
requested review from
mark-kogan-stripe
and removed request for
a team
November 7, 2026 04:53
jar-stripe
enabled auto-merge (squash)
November 7, 2026 05:46
examples/ is excluded from the published package (flit only ships the stripe module), so this has no user-facing distribution impact. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Committed-By-Agent: claude
Contributor
Author
|
Closing — examples/ isn't part of the published package, and this has been addressed in a previous PR. |
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?
Both the
/oauth/callbackand/deauthorizeroutes inexamples/oauth.pyreturn the rawOAuthErrormessage as an unescaped Flask response. Not a live issue —examples/isn't part of the published package (flit only ships thestripemodule) — just inconsistent escaping in sample code.What?
OAuthErrormessage withmarkupsafe.escape()in both except blocksConfiguration
skip-changefile: This PR is not a user-facing change, so there's no changefile.