You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UAF: xml.etree.ElementTree.Element.remove when concurrent mutations happen #126033
Hmm, there seem to be a lot of issues with PyObject_RichCompareBool and custom __eq__'s, right? It might be worth trying to fix things more globally there rather than on a case-by-case basis like this.
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.
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.
changed the title [-]Crash: `xml.etree.ElementTree.Element.remove` with an evil `Element.__eq__`[/-][+]Crash: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/+]on Dec 17, 2024
changed the title [-]Crash: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/-][+]UAF: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/+]on Mar 31, 2025
Activity
ZeroIntensity commentedon Oct 27, 2024
Hmm, there seem to be a lot of issues with
PyObject_RichCompareBooland custom__eq__'s, right? It might be worth trying to fix things more globally there rather than on a case-by-case basis like this.picnixz commentedon Oct 27, 2024
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.
picnixz commentedon Oct 27, 2024
ZeroIntensity commentedon Oct 27, 2024
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.
sobolevn commentedon Oct 28, 2024
Basically, we need to protect
basefrom mutation during the iteration over it. An extra field maybe?picnixz commentedon Oct 28, 2024
See #126041 for that (the issue and PR may have passed under your radar :))
[-]Crash: `xml.etree.ElementTree.Element.remove` with an evil `Element.__eq__`[/-][+]Crash: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/+][-]Crash: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/-][+]UAF: `xml.etree.ElementTree.Element.remove` when concurrent mutations happen[/+]gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when con…
pythongh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` wh…
pythongh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` wh…
[3.13] gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` w…
[3.12] gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` w…