/

CVE-2026-134167

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in devpi-web +doc endpoint

CVE-2026-134167

Received

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized disclosure of server files and sensitive data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An unauthenticated path traversal in devpi-web's documentation route can allow requests to access files outside the documentation directory. Depending on the server's file permissions, exposed files may include the keyfs SQLite database, which contains password hashes.

Affected context

The issue affects devpi-web versions before 5.2.0 in the +doc documentation route. The docs_file_exists and docs_file_path helpers in doczip.py do not confine the resolved relative path to the documentation directory, so specially formed paths may reach files elsewhere on the server.

Exploit preconditions

  • Attack surface: The +doc documentation route
  • Required access: No authentication is required to make a request to the route
  • Trigger point: Handling a documentation request whose relative path resolves outside the documentation directory
  • Why exploitation is possible: The path helpers do not enforce that the resolved file remains within the intended documentation directory

Why this happens

The underlying bug is improper limitation of a pathname to a restricted directory, corresponding to CWE-22: Path Traversal. The route uses a user-influenced relative path without reliably checking that the resulting path stays within the documentation root, allowing access to files beyond the intended area.

Potential impact

  • Attackers may read files accessible to the devpi-web process.
  • Exposed files could reveal sensitive configuration or application data.
  • Disclosure of the keyfs SQLite database may expose stored password hashes.
  • Further compromise may be possible if accessible files contain credentials or other secrets.

General mitigation guidance

Defensive approaches focus on confining file access to an explicitly defined documentation root.

  • Resolve and canonicalize paths, then verify the result remains within the allowed directory.
  • Prefer APIs that safely join paths beneath a trusted root and reject paths that escape it.
  • Avoid treating request-provided path components as trusted filesystem locations.
  • Run the service with least-privilege filesystem permissions and limit access to sensitive data files.
  • Keep sensitive databases and secrets outside directories or permissions reachable by the documentation-serving process.

How teams detect issues like this

  • Use static analysis to identify request-controlled paths passed to filesystem operations without canonicalization and containment checks.
  • Review route handlers and file-serving helpers for path joins that do not enforce a trusted base directory.
  • Add automated tests and policy checks to ensure traversal paths are rejected and resolved paths remain within approved roots.
  • Monitor access logs for unusual documentation requests and unexpected attempts to retrieve non-documentation files.

Sources

SourceLink
github.comgithub.com/devpi/devpi/blob/a67a065777d372acca968ab7b5cf362dc2ceb911/web/devpi_web/doczip.py#L78-L87
github.comgithub.com/devpi/devpi/commit/680fca1607840905dab6c54059b65ba326f46850
github.comgithub.com/devpi/devpi/security/advisories/GHSA-w72q-5vww-p2rh
pypi.orgpypi.org/project/devpi-web/5.2.0/
vulncheck.comvulncheck.com/advisories/devpi-web-before-5.2.0-unauthenticated-path-traversal-via-doc-route

Frequently asked

questions

Yes. The affected documentation route is unauthenticated, so a remote requester may be able to reach it if the devpi-web service is network-accessible.

No authentication is required for requests to the route. The files that can be read depend on the server process's filesystem permissions.

Canonicalize the requested path and verify that it remains beneath a trusted documentation directory before performing filesystem operations.

Treat request-derived paths as untrusted, use path APIs that enforce directory confinement, test traversal cases, and restrict the service's filesystem privileges.

Find out what's already
exploitable in your codebase.