-
-
Notifications
You must be signed in to change notification settings - Fork 32k
UAF: xml.etree.ElementTree.Element.remove
when concurrent mutations happen
#126033
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
Comments
Hmm, there seem to be a lot of issues with |
I've roughly skimmed through the other occurrences and couldn't find UAFs or bad OOB. And I'd prefer fixing them one by one because the patch is not always the same. |
This comment was marked as resolved.
This comment was marked as resolved.
My main concern here is that while we can fix this as much as we want for the core, this looks like it's common enough that downstream is having this problem too. |
Basically, we need to protect |
See #126041 for that (the issue and PR may have passed under your radar :)) |
xml.etree.ElementTree.Element.remove
with an evil Element.__eq__
xml.etree.ElementTree.Element.remove
when concurrent mutations happen
xml.etree.ElementTree.Element.remove
when concurrent mutations happenxml.etree.ElementTree.Element.remove
when concurrent mutations happen
…en concurrent mutations happen (pythonGH-126124) (cherry picked from commit bab1398) Co-authored-by: Bénédikt Tran <[email protected]>
…en concurrent mutations happen (pythonGH-126124) (cherry picked from commit bab1398) Co-authored-by: Bénédikt Tran <[email protected]>
…en concurrent mutations happen (python#126124)
Crash report
What happened?
A UAF in
Element.remove
was fixed in #68279 but one can mutate the child's list during.remove
and cause an OOB crash:Attacked code:
cpython/Modules/_elementtree.c
Lines 1648 to 1656 in dc76a4a
I think we need to introduce some state integer to check that there is no evil mutation (similar to what's being done for
OrderedDict
).CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Output from running 'python -VV' on the command line:
No response
Linked PRs
xml.etree.ElementTree.Element.remove
when concurrent mutations happen #126124xml.etree.ElementTree.Element.remove
when concurrent mutations happen (GH-126124) #131929xml.etree.ElementTree.Element.remove
when concurrent mutations happen (GH-126124) #131930The text was updated successfully, but these errors were encountered: