{{ message }}
[3.13] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368)#151151
Merged
StanFromIreland merged 1 commit intoJun 9, 2026
Merged
Conversation
… protections (pythonGH-139368) (python#150496) Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" [1] attacks. The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and - `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`. This completes the work in f04bea4, and improves the existing related documentation. [1]: https://en.wikipedia.org/wiki/Billion_laughs_attack (cherry picked from commit 6661123) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This was referenced Jun 9, 2026
StanFromIreland
commented
Jun 9, 2026
Documentation build overview
456 files changed ·
|
Sorry, something went wrong.
picnixz
approved these changes
Jun 9, 2026
picnixz
left a comment
Member
There was a problem hiding this comment.
So only gen files and NEWS were manually changed? if so LGTM.
Sorry, something went wrong.
Hide details
View details
StanFromIreland
merged commit
19bc391
into
python:3.13
Jun 9, 2026
45 of 48 checks passed
|
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Sorry, @StanFromIreland, I could not cleanly backport this to |
Sorry, something went wrong.
Member
Author
|
Oh right, the NEWS files. |
Sorry, something went wrong.
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
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.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.
Expose the XML Expat 2.7.2 APIs to tune protections against "billion laughs" 1 attacks.
The exposed APIs are available on Expat parsers, that is, parsers created by
xml.parsers.expat.ParserCreate(), as:parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold), andparser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor).This completes the work in f04bea4, and improves the existing related documentation.
(cherry picked from commit 6661123)