Out-of-bounds Read in Htslib

CVE-2026-31966

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. As one method of removing redundant data, CRAM uses reference-based compression so that instead of storing the full sequence for each alignment record it stores a location in an external reference sequence along with a list of differences to the reference at that location as a sequence of "features". When decoding CRAM records, the reference data is stored in a char array, and parts matching the alignment record sequence are copied over as necessary. Due to insufficient validation of the feature data series, it was possible to make the `cram_decode_seq()` function copy data from either before the start, or after the end of the stored reference either into the buffer used to store the output sequence for the cram record, or into the buffer used to build the SAM `MD` tag. This allowed arbitrary data to be leaked to the calling function. This bug may allow information about program state to be leaked. It may also cause a program crash through an attempt to access invalid memory. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.

Vulnerability class: Buffer Overflow

Published · last modified .

CVSS v3 metric

CVSS v3 base score 9.1 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H.

EPSS exploit prediction

EPSS: 0.007 (49.3th percentile), scored .

Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 49th percentile — 49.3% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2026-31966: held from 0.005 to 0.007.

EPSS over last 30 days · oldest: 0.005 · newest: 0.007 · change: +0.001

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2026-31966?
CVE-2026-31966 is a critical-severity vulnerability in Htslib, classified under Out-of-bounds Read. CVSS score: 9.1/10. Published 2026-03-18.
How severe is CVE-2026-31966?
Critical severity. CVSS v3 base score is 9.1 out of 10.