-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) #115623
Merged
gpshead
merged 39 commits into
python:main
from
hartwork:expat-2-6-0-reparse-deferral-api
Feb 29, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
7cebe78
pyexpat: Implement methods pyexpat.xmlparser.(Get|Set)ReparseDeferral…
hartwork c70fbae
etree: Implement method xml.etree.ElementTree.XMLParser.flush (Python…
hartwork dfca819
pyexpat: Make SetReparseDeferralEnabled available via PyExpat_CAPI
hartwork 4baab67
etree: Implement method xml.etree.ElementTree.XMLParser.flush (C vers…
hartwork 7928942
etree: Implement method xml.etree.ElementTree.XMLPullParser.flush
hartwork e5e4033
etree: Use XMLPullParser.flush to fix XMLPullParserTest for Expat 2.6.0
hartwork bc6e1a7
sax: Implement method xml.sax.expatreader.ExpatParser.flush
hartwork b737f03
sax: Test method xml.sax.expatreader.ExpatParser.flush
hartwork 850e46d
Document new CVE-2023-52425 Expat API (reparse deferral)
hartwork 7002024
_elementtree.c: Document how we know that reparse deferral is enabled
hartwork 2132dfe
sax: Fix xml.sax.expatreader.ExpatParser.flush
hartwork 3d02dfe
etree: Fix xml.etree.ElementTree.XMLParser.flush (Python version)
hartwork fdd2fac
etree: Fix typo "deferall"
hartwork dbbd98c
pyexpat: Cover (Get|Set)ReparseDeferralEnabled by tests
hartwork 3b6ea39
sax: Extend xml.sax.expatreader.ExpatParser.flush test coverage
hartwork 5c1cfb7
Doc/whatsnew/3.13.rst: Mention new Expat reparse deferral API
hartwork a9c666e
pyexpat: Document methods pyexpat.xmlparser.(Get|Set)ReparseDeferralE…
hartwork 35099e3
etree: Document method xml.etree.ElementTree.XMLParser.flush
hartwork 1496e83
etree: Document method xml.etree.ElementTree.XMLPullParser.flush
hartwork a6927ff
etree: Make docs point to xml.etree.ElementTree.XMLPullParser.flush
hartwork c5b2159
pyexpat: Move security warning into SetReparseDeferralEnabled docs
hartwork 082bcc1
pyexpat|etree: Mark new Expat API as added in 3.13 in docs
hartwork f0577e7
pyexpat|sax: Do not be silent about tests skipped for Expat <2.6.0
hartwork f589908
pyexpat: Simplify test ReparseDeferralTest.test_getter_setter_round_trip
hartwork 4915045
Promote xml.parsers.expat.xmlparser instead of pyexpat.xmlparser
hartwork d0ed243
etree: Cover method xml.etree.ElementTree.XMLPullParser.flush
hartwork 62e4fd7
pyexpat: Cut whitespace from ReparseDeferralTest.test_getter_setter_r…
hartwork b0058d5
pyexpat: Drop ReparseDeferralTest.test_getter_initial_value
hartwork 1f70c09
pyexpat: Break a long line for PEP 8
hartwork a77de0f
Doc/whatsnew/3.13.rst: Do not create a link into undocumented class
hartwork 2f07457
etree: Make XMLPullParserTest._feed only flush when needed
hartwork 4b49de9
etree: Fix XMLPullParserTest.test_flush_[..] for C version
hartwork 3c960a6
etree: Break a long line for PEP 8
hartwork 4855bb9
etree: Make test_flush_reparse_deferral_disabled less exclusive
hartwork b6a84b2
etree|sax: Simplify .flush implementations
hartwork 0faa19e
etree: Resolve "is_python" in favor of "ET is pyET"
hartwork 40743a6
etree: Fix emphasis syntax for "immediate" in docs
hartwork a473299
pypexpat: Replace "none" with "NULL" to be correct
hartwork a6baa0b
pyexpat: Indent warning about xmlparser.SetReparseDeferralEnabled
hartwork File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
versionadded
directives for all new methods. Since they are purposed to be backported, I think that you can use.. versionadded:: 3.12.3
. In backports to 3.11 and earlier it will be changed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@serhiy-storchaka I already had that on the radar for later today, will do. I'm unsure how 3.12 should be special here, I'd assume we start out with 3.13 and then adjust during backports for all other 3.x branches. Could you help me understand how 3.12.3 would help over 3.13 when targeting
main
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@serhiy-storchaka PS: 4x
.. versionadded:: 3.13
added now for a startThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature will be supported in the continuous interval "3.12.3-" of Python releases. If the user sees
versionadded:: 3.12.3
, they can understand that in can be used in 3.12 (unless they have not updated it) without checking the 3.12 documentation. It is also a hint that it could be backported in 3,11 and older versions. If the user seesversionadded:: 3.13
, there is no reason to suppose that this feature exist in older releases.It may be only my personal opinion, but I think that this variant is better. But 3.13 is a good start, and we can discuss this later.