CVE-2026-55195: py7zr Denial of Service Vulnerability
MODERATECVE-2026-55195 is a MODERATE denial of service vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting py7zr libraries in the PyPI ecosystem. The issue involves decompression bomb (zip bomb) denial of service via unchecked extraction size. Remediation is available by upgrading affected packages to version 1.1.3.
CVE-2026-55195 at a Glance
How to Fix CVE-2026-55195
To remediate this vulnerability, upgrade all affected py7zr dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install py7zr>=1.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show py7zr
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-55195, inspect your installed packages using pip:
pip show py7zr
Analyze the terminal output to locate any version of py7zr in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.3), your application is affected.
Note: The pip show py7zr command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In py7zr, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-55195 Affected py7zr Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
py7zr
|
PyPI |
< 1.1.3
|
1.1.3
|
References
Frequently Asked Questions
What is CVE-2026-55195?
Which py7zr versions are affected?
What version fixes CVE-2026-55195?
Is py7zr affected?
What CWE is associated with CVE-2026-55195?
How can I check PyPI dependencies for CVE-2026-55195?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gjrg-mpp7-g774",
"modified" : "2026-06-19T21:16:29Z",
"published" : "2026-06-19T21:16:29Z",
"aliases" : [ "CVE-2026-55195" ],
"summary" : "py7zr: Decompression bomb (zip bomb) denial of service via unchecked extraction size",
"details" : "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.\n\nMeasured: 15.6 KB archive → 100 MB output (6,556:1 ratio).\n\n**Proof of concept:**\n\n```python\nimport py7zr, tempfile, os\n\n# create bomb: compress 100MB of zeros into ~15KB\nbomb_path = tempfile.mktemp(suffix='.7z')\nwith py7zr.SevenZipFile(bomb_path, 'w') as z:\n import io\n z.writef(io.BytesIO(b'\\x00' * 100 * 1024 * 1024), 'bomb.bin')\n\nprint(f'archive size: {os.path.getsize(bomb_path):,} bytes')\n\n# extract — no size check\nwith py7zr.SevenZipFile(bomb_path, 'r') as z:\n z.extractall(path=tempfile.mkdtemp())\n\nprint('extracted 100 MB from ~15 KB archive')\n```\n\n**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.\n\n**Fix:** track cumulative decompressed bytes and raise before writing if a limit is exceeded:\n\n```python\nMAX_EXTRACT_SIZE = 2 * 1024 ** 3 # 2 GB default, configurable\n\ntotal = 0\nfor chunk in decompressed_chunks:\n total += len(chunk)\n if total > MAX_EXTRACT_SIZE:\n raise py7zr.exceptions.DecompressionBombError(\n f'Extraction aborted: decompressed size exceeded {MAX_EXTRACT_SIZE} bytes'\n )\n outfile.write(chunk)\n```\n\nTested on py7zr 0.22.0, Python 3.12, Ubuntu 22.04.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "py7zr"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/miurahr/py7zr/security/advisories/GHSA-gjrg-mpp7-g774"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/miurahr/py7zr"
}, {
"type" : "WEB",
"url" : "https://github.com/miurahr/py7zr/releases/tag/v1.1.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-409" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-19T21:16:29Z",
"nvd_published_at" : null
}
}