ZIP extraction tests do not catch predictable temporary-file reuse
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
The report identifies tests/test_utils.py and the TestExtractZippedPaths test class. Read the existing extraction cases, then apply the linked test-only change and run python -m pytest tests/test_utils.py::TestExtractZippedPaths. Done means all eight cases pass and the new tests catch predictable path reuse on the pre-fix revision.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 54.6k
- Forks
- 12.1k
- Avg merge
- 18m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from psf/requests
-
Docs: link security vulnerability reports from CONTRIBUTING.mdPossibly taken @young1lin claimed this 2 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
TestTimeout abandons three delay/10 requests and later tests wait out the serverMay be free again @hananbahi527 claimed this 15 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Incorrect type annotation for iter_linesMay be free again @nightcityblade claimed this 35 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Similar issues
-
factory
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Arize-ai/phoenix#17420 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
FireDynamics/LEDSmokeAnalysis#176 ·
Maintainers usually reply within 1 day
-
PC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dlt-contrib/dlt-filesystem#51 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day