Keep next_in and avail_in in sync in bz2/lzma/zlib decompressor reset paths
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug report
Bug description:
(This was found by Gemini, orchestrated by Dirk Mueller at SUSE)
For https://github.com/advisories/GHSA-pg25-7cx5-cvcm the "next_in" pointers were reset to NULL. However if the decompressor is reused, the "avail_in_real" counter should also be reset to "0" at this time, as if its reused again, next_in and avail_in_real might not be in sync again.
This affects
Modules/_bz2module.c
Modules/_lzmamodule.c
Modules/zlibmodule.c
For bz2, everywhere where next_in is set to NULL, avail_in_real also needs to be set to 0.
++ bzs->next_in = NULL;
should also set
bzs->avail_in_real = 0;
similar for the others.
This is largely hardening. It is not clear if these use cases exist.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Überprüfe die Reset-Pfade in Modules/_bz2module.c, Modules/_lzmamodule.c und Modules/zlibmodule.c und lokalisiere jede Zuweisung, die next_in auf NULL setzt. Bestätige, dass jeder solche Reset auch avail_in_real leert, führe anschließend die relevanten Dekompressor-Tests aus und überprüfe, dass der wiederverwendete Dekompressorstatus synchron bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- backend, security
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 62/100