mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139359)
* [3.14] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-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 commitf04bea44c3) (cherry picked from commit68a1778b77)
This commit is contained in:
parent
4d7fab9b15
commit
bf2865f80f
7 changed files with 586 additions and 32 deletions
|
|
@ -0,0 +1,5 @@
|
|||
Add :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
|
||||
and :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
|
||||
to :ref:`xmlparser <xmlparser-objects>` objects to prevent use of
|
||||
disproportional amounts of dynamic memory from within an Expat parser.
|
||||
Patch by Bénédikt Tran.
|
||||
Loading…
Add table
Add a link
Reference in a new issue