cve.bz

CVE-2026-31962 htslib htslib: Heap-based Buffer Overflow

8.8 highEPSS 0.4%Fix available

High (8.8) in htslib htslib. EPSS 0.4% estimated probability of exploitation activity in the next 30 days.

On this page
HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the `cram_decode_seq()` did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by the program. It may be possible to use this to obtain arbitrary code execution. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.

Severity

CVSS 4.0

8.8 high
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.4% (unchanged from 0.4% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 38th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2026-03-18. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-122 Heap-based Buffer Overflow
CWE-125 Out-of-bounds Read
CWE-129 Improper Validation of Array Index
CWE-787 Out-of-bounds Write
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-31962 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-31962?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-31962?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-31962 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
htslib:htslibbefore 1.21.1
htslib:htslibfrom 1.22 before 1.22.2
htslib:htslib1.23

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13htslibno fix listedDEBIAN-CVE-2026-31962
Debian14htslib1.24-2DEBIAN-CVE-2026-31962
Ubuntu20.04:LTS, 22.04:LTS, 24.04:LTS and 6 morehtslibno fix listedUBUNTU-CVE-2026-31962

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This is an IMPORTANT heap buffer overflow flaw in the HTSlib CRAM reader. The vulnerability can be triggered when processing a specially crafted CRAM file, potentially leading to application crashes, data corruption, or arbitrary code execution. This issue affects Red Hat Community Projects, including EPEL and Fedora.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-31962.

Attack patterns (CAPEC)

  • CAPEC-92 Forced Integer Overflow Likelihood: High · Severity: High
  • CAPEC-540 Overread Buffers Likelihood: Low · Severity: High
  • CAPEC-100 Overflow Buffers Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON