CVE-2026-31968

HIGH

HTSlib CRAM decoder vulnerable to buffer overflow

Title source: cna
STIX 2.1

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.

Scores

CVSS v3 8.1
EPSS 0.0002
EPSS Percentile 4.2%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H

CISA SSVC

Vulnrichment
Exploitation none
Automatable yes
Technical Impact partial

Details

CWE
CWE-121 CWE-122 CWE-787 CWE-843
Status published
Products (5)
htslib/htslib 1.23
htslib/htslib < 1.21.1
samtools/htslib < 1.21.1
samtools/htslib = 1.23
samtools/htslib >= 1.22, < 1.22.2
Published Mar 18, 2026
Tracked Since Mar 19, 2026