Buffer Overflow Vulnerability in HTSlib Bioinformatics Library
CVE-2026-31971

7.1HIGH

Key Information:

Vendor

Samtools

Status
Vendor
CVE Published:
18 March 2026

What is CVE-2026-31971?

HTSlib, a library designed for handling bioinformatics file formats, is susceptible to a buffer overflow when improperly unpacking data using the BYTE_ARRAY_LEN encoding method. This flaw arises in the function cram_byte_array_len_decode(), which fails to verify that the unpacked data aligns with the output buffer size. As a result, opening a maliciously crafted CRAM file can lead to unexpected program crashes, memory corruption, or changes in control flow. Attackers could exploit this vulnerability to potentially execute arbitrary code if their input is processed. Users are urged to upgrade to the fixed versions 1.23.1, 1.22.2, or 1.21.1, as there is no alternative workaround available.

Affected Version(s)

htslib < 1.21.1 < 1.21.1

htslib >= 1.22, < 1.22.2 < 1.22, 1.22.2

htslib = 1.23 = 1.23

References

CVSS V4

Score:
7.1
Severity:
HIGH
Confidentiality:
None
Integrity:
High
Availability:
Low
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
Unknown

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.