CVE-2023-40587
Pyramid static view path traversal up one directory
Also known as GHSA-j8g2-6fc7-q8f8, PYSEC-2026-1840
Mitigation
- Upgrade pyramid to 2.0.2 or later.
Who should check
- Projects that depend on PyPI package pyramid (>= 2.0.0, < 2.0.2)
- Anyone running Pylons pyramid >= 2.0.0, < 2.0.2
Vulnerability facts
- Affected
- pyramid >= 2.0.0, < 2.0.2
- Fixed in
- 2.0.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 4.3 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: Low
- Integrity impact: None
- Availability impact: None
- EPSS
- 0.83% chance of exploitation in 30 days (percentile 55, 2026-11-26)
- CWE
- CWE-22
- Modified
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.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2023-40587. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2023-40587.md Affected: pyramid >= 2.0.0, < 2.0.2 Fixed in: 2.0.2 Steps: 1. Search this machine and project for pyramid (PyPI), Pylons pyramid: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
Other
- https://github.com/python/cpython/issues/106242
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OQIPHQTM3XE5NIEXCTQFV2J2RK2YUSMT/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LYSDTQ7NP5GHPQ7HBE47MBJQK7YEIYMF/
- https://github.com/Pylons/pyramid
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LYSDTQ7NP5GHPQ7HBE47MBJQK7YEIYMF
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OQIPHQTM3XE5NIEXCTQFV2J2RK2YUSMT
- https://pypi.org/project/pyramid
FAQ
Is CVE-2023-40587 being exploited?
There is no confirmed exploitation: CVE-2023-40587 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.83% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2023-40587?
Medium: CVSS 4.3 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2023-40587?
pyramid >= 2.0.0, < 2.0.2.
Is there a fix for CVE-2023-40587?
Yes. Fixed in 2.0.2. Upgrade pyramid to 2.0.2 or later.
How do I check if I'm affected by CVE-2023-40587?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.