Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI

GHSA-j8g2-6fc7-q8f8

MEDIUMFix: python/cpython#106816

GHSA-j8g2-6fc7-q8f8 is a medium-severity (CVSS 5.3) Path Traversal vulnerability in pyramid. O3 Security confirms whether GHSA-j8g2-6fc7-q8f8 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Pyramid static view path traversal up one directory

Also known asCVE-2023-40587PYSEC-2026-1840
Published
Aug 25, 2023
Updated
Jul 7, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

Real-World Exposure

1 pkg affected
🐍pyramid

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Impact

This 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.

Example:

config.add_static_view(name='static', path='/usr/src/app/static', cache_max_age=0)

And directory tree:

/usr/src/app \
              | - static \
                          | - file.css
                          | - index.html
                          | - ...
              | - index.html <-- (this file could be disclosed with this bug)

Patches

Pyramid now will reject 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, see:

At the time the following Python versions are not fixed:

  • Python 3.11.0 to 3.11.4
  • Python 3.12.0a1 to 3.12.0rc1

Fixes will be available in: Python 3.12.0rc2 or 3.11.5.

Please note that release candidates of Python are not production ready and should not be used for production workloads.

Workarounds

Use a version of Python 3 that is not affected. Downgrade to Python 3.10 series temporarily, or wait till Python 3.11.5 is released and upgrade to the latest version of Python 3.11 series.

References

Thanks

  • Masashi Yamane of LAC Co., Ltd

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIpyramid2.0.0&&< 2.0.22.0.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pyramid. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update pyramid to 2.0.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-j8g2-6fc7-q8f8 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-j8g2-6fc7-q8f8 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-j8g2-6fc7-q8f8. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Impact This 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`. Example: ``` config.add_static_view(name='static', path='/usr/src/app/static', cache_max_age=0) ``` And directory tree: ``` /usr/src/app \ | - static \ | - file.css | - index.html
O3 Security · Impact-Aware SCA

Is GHSA-j8g2-6fc7-q8f8 in your dependencies?

O3 detects GHSA-j8g2-6fc7-q8f8 across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.