Skip to content

[3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) - #116248

Merged
gpshead merged 4 commits into
python:3.12from
hartwork:backport-6a95676-3.12
Mar 6, 2024
Merged

[3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623)#116248
gpshead merged 4 commits into
python:3.12from
hartwork:backport-6a95676-3.12

Conversation

@hartwork

@hartworkhartwork commented Mar 2, 2024

Copy link
Copy Markdown
Contributor

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 #115138 (comment) .

Includes code suggested-by: Snild Dolkow snild@sony.com
and by core dev Serhiy Storchaka.

(cherry picked from commit 6a95676)


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

…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 security 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)
Comment threadDoc/library/pyexpat.rst Outdated
As suggested by Serhiy Storchaka
Comment threadInclude/pyexpat.h
hartworkand others added 2 commits March 6, 2024 22:12
…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)
@hartwork
hartworkforce-pushed the backport-6a95676-3.12 branch from a5a8f3c to cafaa33CompareMarch 6, 2024 21:26
@gpshead
gpshead enabled auto-merge (squash) March 6, 2024 21:41
@gpshead
gpshead merged commit 0a01ed6 into python:3.12Mar 6, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-featureA feature request or enhancementtype-securityA security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hartwork@gpshead@serhiy-storchaka