pyexpat: CPython can be crashed through resetting `StartDoctypeDeclHandler` with pyexpat at the wrong time
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
The report provides a reproducer using xml.parsers.expat.ParserCreate and says Expat upstream pull request #1437 fixes the crash. Start by checking how CPython vendors or updates Expat and whether that upstream fix is already included. Done means the reproducer no longer crashes; the report says this is defense-in-depth, not a vulnerability.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hello!
It has been brought to my attention that the Expat XML parser can be crashed via a segmentation fault by resetting member StartDoctypeDeclHandler at the wrong time, like this:
from xml.parsers.expat import ParserCreate
parser = ParserCreate()
def reset_start_doctype_handler():
parser.StartDoctypeDeclHandler = None
return True
parser.StartDoctypeDeclHandler = lambda *_: None
parser.NotStandaloneHandler = reset_start_doctype_handler
parser.Parse(b"<!DOCTYPE r SYSTEM \"s\"><r/>", True)
This affects all versions of Python with all versions of Expat up to 2.9.0 including. Expat upstream pull request https://github.com/libexpat/libexpat/pull/1437 fixes this issue for itself and CPython and the fix will be contained in the next release that may come out as early as next Monday. So updating to the next release will fix this for Python for free, I just wanted to let you know.
Credits for this finding go to Bartłomiej Dmitruk (@hackerman70000) of https://www.striga.ai/ .
Bartłomiej reported this as defense-in-depth to me and we both do not consider this a vulnerability. If you come to difference conclusions, please let me know.
Best, Sebastian
CC @StanFromIreland @picnixz
- Vorherrschende Sprache
- Python
- Sterne
- 77.7k
- Forks
- 38.3k
- Ø Merge
- 13 Std. 43 Min.
- Gemergte PRs (30 T.)
- 704
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python/cpython
-
topic-socket type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python/cpython#160561 · 7 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
tests topic-profiling type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python/cpython#160334 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`iso2022_jp_3` encodes U+9B1D but decodes the result as U+9B1CEvtl. vergeben @kinqsradio hat das vor 1 Tag übernommen. Offenextension-modules type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
interpreter-core type-feature
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
python/cpython#160109 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
extension-modules type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python/cpython#160001 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
follow-up
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
modelscope/modelscope#1833 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ocr_data_to_elements() raises AttributeError when a layout element is a ListEvtl. vergeben @Eapp1e hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Unstructured-IO/unstructured#4616 ·
Maintainer antworten meist innerhalb von 1 Tag