-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-42051: Reject XML entity declarations in plist files #22760
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
Conversation
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.
Thanks, that's a simple and great solution for the issue. LGTM
@ronaldoussoren: Please replace |
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
) (cherry picked from commit 05ee790) Co-authored-by: Ronald Oussoren <[email protected]>
GH-22771 is a backport of this pull request to the 3.9 branch. |
) (cherry picked from commit 05ee790) Co-authored-by: Ronald Oussoren <[email protected]>
GH-22772 is a backport of this pull request to the 3.8 branch. |
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, @ronaldoussoren, I could not cleanly backport this to |
Sorry @ronaldoussoren, I had trouble checking out the |
Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, @ronaldoussoren, I could not cleanly backport this to |
I'm looking at the conflicts. |
GH-22801 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit 05ee790) Co-authored-by: Ronald Oussoren <[email protected]>
(cherry picked from commit 05ee790) Co-authored-by: Ronald Oussoren <[email protected]>
…-22801) Co-authored-by: Ronald Oussoren <[email protected]>
) (pythonGH-22801) Co-authored-by: Ronald Oussoren <[email protected]> (cherry picked from commit e512bc7) Co-authored-by: Ned Deily <[email protected]>
…H-22801) (GH-22804) Co-authored-by: Ronald Oussoren <[email protected]> (cherry picked from commit e512bc7) Co-authored-by: Ned Deily <[email protected]>
) (pythonGH-22801) (pythonGH-22804) Co-authored-by: Ronald Oussoren <[email protected]> (cherry picked from commit e512bc7) Co-authored-by: Ned Deily <[email protected]> Rebased for Python 2.7 by Michał Górny <[email protected]>
… (GC-22801) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Ned Deily <[email protected]>
bpo-42051: Reject XML entity declarations in plist files (python#22760) (GC-22801)
… (GC-22801) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Ned Deily <[email protected]>
… (GC-22801) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Ned Deily <[email protected]> Add InvalidFileException class. RaisesRegex is RaisesRegexp in python2. plistlib.loads is in the python3 version of plistlib, but there are too many changes to backport this simply.
… (GC-22801) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Ned Deily <[email protected]> Add InvalidFileException class. RaisesRegex is RaisesRegexp in python2. plistlib.loads is in the python3 version of plistlib, but there are too many changes to backport this simply.
plistlib uses ElementTree to parse XML files, and therefore is subject to a number of XML vulnerabilities. Those can be avoided by rejecting entity declarations in XML plist files.
Doing this is safe because Apple tools like plutil(1) also reject XML files with entity declarations.
https://bugs.python.org/issue42051