CVE-2023-40587Pyramid static view path traversal up one directory
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.
What to do
Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | python-pyramid | Fix pending | UBUNTU-CVE-2023-40587 | |
| Ubuntu 26.04 | python-pyramid | Under investigation | UBUNTU-CVE-2023-40587 | |
| Ubuntu 25.10 | python-pyramid | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-40587 | |
| Ubuntu 24.04 | python-pyramid | Under investigation | UBUNTU-CVE-2023-40587 | |
| Ubuntu 22.04 | python-pyramid | Under investigation | UBUNTU-CVE-2023-40587 | |
| Ubuntu 20.04 | python-pyramid | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-40587 | |
| Ubuntu 18.04 | python-pyramid | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-40587 | |
| Ubuntu 16.04 | python-pyramid | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-40587 | |
| Ubuntu 14.04 | python-pyramid | Will not fix Ubuntu decided not to fix this in this release | ||
| Debian 14 | python-pyramid | Fixed | 2.0.2+dfsg-1 | DEBIAN-CVE-2023-40587 |
| Debian 13 | python-pyramid | Fixed | 2.0.2+dfsg-1 | DEBIAN-CVE-2023-40587 |
| Debian 12 | python-pyramid | Fixed | 2.0+dfsg-2+deb12u1 | DEBIAN-CVE-2023-40587 |
| PyPI library | pyramid | Fixed | 2.0.2 | PYSEC-2026-1840 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Pylons pyramid: affected: >= 2.0.0, < 2.0.2
References
- https://github.com/Pylons/pyramid/security/advisories/GHSA-j8g2-6fc7-q8f8
- https://github.com/python/cpython/issues/106242
- https://github.com/python/cpython/pull/106816
- https://github.com/Pylons/pyramid/commit/347d7750da6f45c7436dd0c31468885cc9343c85
- 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/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.