ZIP extraction tests do not catch predictable temporary-file reuse
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Il rapporto indica tests/test_utils.py e la classe di test TestExtractZippedPaths. Leggi i casi di estrazione esistenti, poi applica la modifica collegata che riguarda solo i test ed esegui python -m pytest tests/test_utils.py::TestExtractZippedPaths. Il lavoro è concluso quando tutti gli otto casi passano e i nuovi test rilevano il riutilizzo prevedibile dei percorsi nella revisione precedente alla correzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The existing TestExtractZippedPaths cases pass against the implementation from before the fix for CVE-2026-25645. They do not exercise a pre-existing file at the basename destination or extraction of same-named members from different archives. Current Requests already contains the fix; this report concerns the missing regression coverage.
Expected Result
The extraction tests should catch reuse of a predictable temporary filename. Extracting a ZIP member should return its content without reusing or overwriting an unrelated existing file. Members with the same basename from different archives should retain separate paths and contents.
Actual Result
The six existing extraction cases pass on the pre-fix revision 8b9bc8fc0f63be84602387913c4b689f19efd028.
Two additional tests catch the regression. One creates an unrelated file at the old basename destination; the other extracts same-named members from two archives. Both fail on that pre-fix revision because extraction returns the reused path. All eight cases pass with the original fix, 66d21cb07bd6255b1280291c4fafb71803cdb3b7, and on main at 3c7baaa05ab4aa49cc819ce3a819d260de19c157.
Reproduction Steps
The complete test-only change is in openforge-live/requests@abf2080. It changes only tests/test_utils.py, uses small ZIP files in pytest temporary directories, and leaves production code unchanged.
Apply that commit to main at 3c7baaa, then run:
python -m pytest tests/test_utils.py::TestExtractZippedPaths
The expected result is eight passes. Running the same extraction test class against the pre-fix package produces two failures at the assertions that the returned paths must be distinct. The six existing cases still pass.
The prepared commit is linked here because this account cannot open a pull request under the repository's current collaborators-only PR setting.
System Information
Verified on Linux with Python 3.13.13 and pytest 9.0.3, importing Requests from the source revisions above. The entire current tests/test_utils.py file passes: 218 passed, 13 skipped. The full integration suite, Windows and PyPy were not run.
- Lingua principale
- Python
- Stelle
- 54.6k
- Fork
- 12.1k
- Merge medio
- 18m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di psf/requests
-
Docs: link security vulnerability reports from CONTRIBUTING.mdForse già presa @young1lin l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
TestTimeout abandons three delay/10 requests and later tests wait out the serverForse di nuovo libera @hananbahi527 l’ha presa 15 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Incorrect type annotation for iter_linesForse di nuovo libera @nightcityblade l’ha presa 35 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
Tutte le issue di psf/requests
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ComposioHQ/awesome-claude-skills#2398 ·
I maintainer di solito rispondono entro 2 giorni
-
bug converter
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
grafana/sigma-rule-deployment#435 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
datamodel-code-generator/datamodel-code-generator#5589 ·
I maintainer di solito rispondono entro 1 giorno
-
Shell: serve the home app's Cookie Policy on a hard reloadForse già presa @2001anshkaushik l’ha presa oggi. Apertafeature module:ai
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
rocketride-org/rocketride-server#2899 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
GEFSv12
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100