Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

ZIP extraction tests do not catch predictable temporary-file reuse

Abierto Apto para principiantes
#7,638 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

El informe identifica tests/test_utils.py y la clase de pruebas TestExtractZippedPaths. Lee los casos de extracción existentes, aplica el cambio de solo pruebas enlazado y ejecuta python -m pytest tests/test_utils.py::TestExtractZippedPaths. La tarea estará terminada cuando pasen los ocho casos y las nuevas pruebas detecten la reutilización previsible de rutas en la revisión anterior a la corrección.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
54.6k
Forks
12.1k
Merge medio
18 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de psf/requests

Todos los issues de psf/requests

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.