Skip to content

Conversation

@hartwork
Copy link
Contributor

@hartworkhartwork commented Oct 2, 2025

Expose the XML Expat 2.7.2 mitigation APIs to disallow use of disproportional amounts of dynamic memory from within an Expat parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is, parsers created by xml.parsers.expat.ParserCreate(), as:

  • parser.SetAllocTrackerActivationThreshold(threshold), and
  • parser.SetAllocTrackerMaximumAmplification(max_factor).

(cherry picked from commit f04bea4)

CC @picnixz


📚 Documentation preview 📚: https://cpython-previews--139529.org.readthedocs.build/

picnixzand others added 4 commits October 3, 2025 01:30
…2025-59375) (python#139234) Expose the XML Expat 2.7.2 mitigation APIs to disallow use of disproportional amounts of dynamic memory from within an Expat parser (see CVE-2025-59375 for instance). The exposed APIs are available on Expat parsers, that is, parsers created by `xml.parsers.expat.ParserCreate()`, as: - `parser.SetAllocTrackerActivationThreshold(threshold)`, and - `parser.SetAllocTrackerMaximumAmplification(max_factor)`. (cherry picked from commit f04bea4)
…on API (python#139366) Fix some typos left in f04bea4, and simplify some internal functions to ease maintenance of future mitigation APIs. (cherry picked from commit 68a1778)
@picnixz
Copy link
Member

To have a good synchronization, we'll also delay 3.10 to 3.13 backports for their next release cycle (see #139359 (comment)).

@picnixzpicnixz self-assigned this Oct 7, 2025
@ambv
Copy link
Contributor

ambv commented Oct 8, 2025

I set DO-NOT-MERGE to avoid confusion. Unset that when you think we should be releasing this.

@hartwork
Copy link
ContributorAuthor

@pablogsal do you have a minute for this?

@hartwork
Copy link
ContributorAuthor

@pablogsal do you have a minute for this? 🙏

@pablogsalpablogsal merged commit 9bbb68a into python:3.11Nov 25, 2025
24 checks passed
@pablogsal
Copy link
Member

Thanks a lot for the backport and thanks for the patience :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hartwork@picnixz@ambv@pablogsal