CVE-2023-40587

Pyramid static view path traversal up one directory

4.3 medium EPSS 0.83%

Published 25 Aug 2023 Updated 13 Feb 2025 CNA: GitHub_M

Check your servers for CVE-2023-40587

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-40587 affects pyramid, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

Pyramid is an open source Python web framework. A path traversal vulnerability in Pyramid versions 2.0.0 and 2.0.1 impacts users of Python 3.11 that are using a Pyramid static view with a full filesystem path and have a `index.html` file that is located exactly one directory above the location of the static view's file system path. No further path traversal exists, and the only file that could be disclosed accidentally is `index.html`. Pyramid version 2.0.2 rejects any path that contains a null-byte out of caution. While valid in directory/file names, we would strongly consider it a mistake to use null-bytes in naming files/directories. Secondly, Python 3.11, and 3.12 has fixed the underlying issue in `os.path.normpath` to no longer truncate on the first `0x00` found, returning the behavior to pre-3.11 Python, un an as of yet unreleased version. Fixes will be available in:Python 3.12.0rc2 and 3.11.5. Some workarounds are available. Use a version of Python 3 that is not affected, downgrade to Python 3.10 series temporarily, or wait until Python 3.11.5 is released and upgrade to the latest version of Python 3.11 series.

Severity (CVSS)

4.3 medium CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
low: an attack works without special conditions
Privileges required
none: the attacker does not need an account
User interaction
required: a user has to do something, such as open a link or a file
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality low, integrity none, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.83%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 54.7% of all scored CVEs. Scores of 29 Nov 2026.

Weakness

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory

Affected products

As the CNA lists them.

ProductVersions
pyramid
affected >= 2.0.0, < 2.0.2

Is my server affected?

Find the installed version of pyramid and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i pyramid
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-40587 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-40587

RHEL, Rocky, Alma, Fedora

rpm -q pyramid
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-40587

Alpine

apk list --installed | grep -i pyramid

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-40587
trivy image --scanners vuln IMAGE | grep CVE-2023-40587

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2023-40587 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.