CVE-2026-31964

HTSlib CRAM decoder has a NULL Pointer Dereference

Published Mar 18, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
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. 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 `CONST`, `XPACK` and `XRLE` encodings did not properly implement the interface needed to do this. Trying to decode records with omitted sequence or quality data using these encodings would result in an attempt to write to a NULL pointer. Exploiting this bug causes a NULL pointer dereference. Typically this will cause the program to crash. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.

Analysis

AI-generated

Technical impact

HTSlib is a widely used library for processing bioinformatics file formats, including the compressed CRAM format. The vulnerability lies in the handling of CONST, XPACK, and XRLE encodings when a CRAM record omits sequence or quality data. Because the decoder incorrectly writes to a null pointer under these conditions, the resulting crash is a classic NULL Pointer Dereference (CWE‑476). The impact is a denial‑of‑service condition; no direct data exfiltration or code execution is provided by the flaw itself.

Affected Systems

The affected product is samtools:htslib. All releases of HTSlib that predates the specific patched versions are vulnerable. The CVE notes that versions 1.23.1, 1.22.2, and 1.21.1 contain the fix; therefore any older version (including 1.23.0, 1.22.1, 1.21.0, etc.) is considered vulnerable.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity, while the EPSS score of less than 1 % suggests a low likelihood of widespread exploitation in the near term. The vulnerability is not listed in CISA’s KEV catalog. The most plausible attack vector is the delivery of a malicious CRAM file that triggers the faulty decoder during normal processing, which could occur via a local user or a remote user submitting data to an application that incorporates HTSlib. The exploit will cause the consuming process to crash, leading to service interruption but not compromising other system components.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade HTSlib to version 1.23.1, 1.22.2, or 1.21.1, or later, as these releases contain the bug fix.
  • Verify that any applications using HTSlib are linked against the patched library; if an upgrade cannot be performed immediately, avoid processing CRAM files that omit sequence or quality data until the fix is applied.

Generated by OpenCVE AI on March 19, 2026 at 16:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Htslib
Htslib htslib
CPEs cpe:2.3:a:htslib:htslib:*:*:*:*:*:*:*:*
cpe:2.3:a:htslib:htslib:1.23:*:*:*:*:*:*:*
Vendors & Products Htslib
Htslib htslib
Metrics cvssV3_1

{'score': 5.0, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Type Values Removed Values Added
First Time appeared Samtools
Samtools htslib
Vendors & Products Samtools
Samtools htslib
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.0, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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. 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 `CONST`, `XPACK` and `XRLE` encodings did not properly implement the interface needed to do this. Trying to decode records with omitted sequence or quality data using these encodings would result in an attempt to write to a NULL pointer. Exploiting this bug causes a NULL pointer dereference. Typically this will cause the program to crash. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.
Title HTSlib CRAM decoder has a NULL Pointer Dereference
Weaknesses CWE-476
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 18, 2026, 6:46 PM
Reserved
Mar 10, 2026, 3:40 PM
Status
Analyzed
Published
Mar 18, 2026, 7:16 PM
Modified
Jun 17, 2026, 10:34 AM
Severity
Moderate
Public date
Mar 18, 2026, 6:27 PM