CVE-2026-31967
JSON

6.9medium

HTSlib CRAM reader has out-of-bounds read due to improper validation of input

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.63% (higher than 44% of CVEs)
Published
Last changed
Assigned by
GitHub_M

Description

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, the value of the mate reference id field was not validated. Later use of this value, for example when converting the data to SAM format, could result in the out of bounds array reads when looking up the corresponding reference name. If the array value obtained also happened to be a valid pointer, it would be interpreted as a string and an attempt would be made to write the data as part of the SAM record. 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.

Affected

Product or packageVersionsReported by
samtools htslib< 1.21.1, >= 1.22, < 1.22.2, = 1.23CVE List
htslib htslibbefore 1.21.1, from 1.22 before 1.22.2, 1.23NVD

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Classification

CWE-125CWE-129

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, the value of the mate reference id field was not validated. Later use of this value, for example when converting the data to SAM format, could result in the out of bounds array reads when looking up the corresponding reference name. If the array value obtained also happened to be a valid pointer, it would be interpreted as a string and an attempt would be made to write the data as part of the SAM record. 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.

NVD (es)

HTSlib es una biblioteca para leer y escribir formatos de archivo bioinformáticos. CRAM es un formato comprimido que almacena datos de alineación de secuencias de ADN. En la función 'cram_decode_slice()' llamada al leer registros CRAM, el valor del campo 'mate reference id' no fue validado. El uso posterior de este valor, por ejemplo al convertir los datos a formato SAM, podría resultar en lecturas de array fuera de límites al buscar el nombre de referencia correspondiente. Si el valor del array obtenido también resultara ser un puntero válido, sería interpretado como una cadena y se intentaría escribir los datos como parte del registro SAM. Este error podría permitir que se filtre información sobre el estado del programa. También podría causar un fallo del programa a través de un intento de acceder a memoria inválida. Las versiones 1.23.1, 1.22.2 y 1.21.1 incluyen correcciones para este problema. No hay solución alternativa para este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31967 changed 2026-03-18CVE Terms of Use
NVDCVE-2026-31967 changed 2026-06-17Public domain