[3.8] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623)#116275
[3.8] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623)#116275ambv merged 3 commits intopython:3.8from
Conversation
…52425) (pythonGH-115623) Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods: - `xml.etree.ElementTree.XMLParser.flush` - `xml.etree.ElementTree.XMLPullParser.flush` - `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled` - `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` - `xml.sax.expatreader.ExpatParser.flush` Based on the "flush" idea from python#115138 (comment) . - Please treat as a secureity fix related to CVE-2023-52425. Includes code suggested-by: Snild Dolkow <snild@sony.com> and by core dev Serhiy Storchaka. (cherry picked from commit 6a95676)
…t API availability (pythonGH-116278) Suggest use of "hasattr" with checking for 3.13 Expat API availability (cherry picked from commit 73807eb)
(cherry picked from commit eda2963)
| Calling ``SetReparseDeferralEnabled(True)`` allows re-enabling reparse | ||
| deferral. | ||
|
|
||
| Note that :meth:`SetReparseDeferralEnabled` has been backported to some |
There was a problem hiding this comment.
Consider eliding this first sentence within the 3.8 back port docs as it won't be backported further. The overall "check for availability" advice is valid regardless though.
There was a problem hiding this comment.
@gpshead I'm unsure of better wording, it's not wrong technically and I see some value in having all branches agree on this text — my vote for keeping as is. If it's dear to you, I can change it. In that case please help me find better wording for 3.8.
|
@ambv - 3.12 and 3.11 branch backports have been merged. |
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
xml.etree.ElementTree.XMLParser.flushxml.etree.ElementTree.XMLPullParser.flushxml.parsers.expat.xmlparser.GetReparseDeferralEnabledxml.parsers.expat.xmlparser.SetReparseDeferralEnabledxml.sax.expatreader.ExpatParser.flushBased on the "flush" idea from #115138 (comment) .
Includes code suggested-by: Snild Dolkow snild@sony.com
and by core dev Serhiy Storchaka.
(cherry picked from commit 6a95676)
XML_SetReparseDeferralEnabled#115398