CVE-2026-31968

HTSlib CRAM decoder vulnerable to buffer overflow

HIGH
8.1
CVSS Score
Published: March 18, 2026 at 07:38 PM UTC
Updated: June 17, 2026 at 10:34 AM UTC
2 products affected across 2 vendorsHtslibHTSlib

Using htslib by samtools?

Get instant alerts when new vulnerabilities affect htslib - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.1
Exploit prediction
EPSS 0.4%
SSVC
No known exploit

Description

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. For the `VARINT` and `CONST` encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. Depending on the data stream this could result either in a heap buffer overflow or a stack overflow. If a user opens a file crafted to exploit this issue it could lead to the program crashing, overwriting of data structures on the heap or stack in ways not expected by the program, or changing the control flow of 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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 1.21.11.22 ≤ v < 1.22.21.23
v < 1.21.1v < 1.22.2= 1.23
Affected range stops below 1.21.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 1.22.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (2)

SSVC — Action Prioritization

SSVCNo known exploitAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
NONE
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-121CWE-122CWE-787CWE-843

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card