Skip to content

Conversation

hartwork
Copy link
Contributor

@hartwork hartwork commented Mar 3, 2024

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 [email protected]
and by core dev Serhiy Storchaka.

(cherry picked from commit 6a95676)

…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 <[email protected]>
and by core dev Serhiy Storchaka.

(cherry picked from commit 6a95676)
hartwork and others added 2 commits March 6, 2024 22:21
…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)
@gpshead
Copy link
Member

gpshead commented Mar 6, 2024

3.12 and 3.11 branch backports have been merged.

@ambv ambv merged commit 516a6d4 into python:3.10 Mar 6, 2024
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Mar 23, 2024
Since 3.10.14, Pyhon uses the "reparse deferral API" in expat >= 2.6.0:

   python/cpython#116270
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Mar 24, 2024
Since 3.10.14, Pyhon uses the "reparse deferral API" in expat >= 2.6.0:

   python/cpython#116270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement type-security A security issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants