CVE-2026-31971

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. When reading data encoded using the `BYTE_ARRAY_LEN` method, the `cram_byte_array_len_decode()` failed to validate that the amount of data being unpacked matched the size of the output buffer where it was to be stored. Depending on the data series being read, this could result either in a heap or a stack overflow with attacker-controlled bytes. 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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:a:htslib:htslib:*:*:*:*:*:*:*:*
cpe:2.3:a:htslib:htslib:*:*:*:*:*:*:*:*
cpe:2.3:a:htslib:htslib:1.23:*:*:*:*:*:*:*

History

17 Jun 2026, 10:34

Type Values Removed Values Added
Summary
  • (es) HTSlib es una biblioteca para leer y escribir formatos de archivo de bioinformática. CRAM es un formato comprimido que almacena datos de alineación de secuencias de ADN utilizando una variedad de codificaciones y métodos de compresión. Al leer datos codificados utilizando el método 'BYTE_ARRAY_LEN', la función 'cram_byte_array_len_decode()' no validó que la cantidad de datos que se estaban desempaquetando coincidiera con el tamaño del búfer de salida donde se iba a almacenar. Dependiendo de la serie de datos que se leyera, esto podría resultar en un desbordamiento de montón o un desbordamiento de pila con bytes controlados por el atacante. Dependiendo del flujo de datos, esto podría resultar en un desbordamiento de búfer en el montón o un desbordamiento de pila. Si un usuario abre un archivo diseñado para explotar este problema, podría provocar el bloqueo del programa, la sobrescritura de estructuras de datos en el montón o la pila de maneras no esperadas por el programa, o el cambio del flujo de control del programa. Podría ser posible usar esto para obtener ejecución de código arbitrario. Las versiones 1.23.1, 1.22.2 y 1.21.1 incluyen correcciones para este problema. No hay una solución alternativa para este problema.

19 Mar 2026, 13:58

Type Values Removed Values Added
CPE cpe:2.3:a:htslib:htslib:1.23:*:*:*:*:*:*:*
cpe:2.3:a:htslib:htslib:*:*:*:*:*:*:*:*
First Time Htslib htslib
Htslib
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 8.1
References () https://github.com/samtools/htslib/commit/01cd003b46fa2ebea4d9be5475b11217eb4c11be - () https://github.com/samtools/htslib/commit/01cd003b46fa2ebea4d9be5475b11217eb4c11be - Patch
References () https://github.com/samtools/htslib/security/advisories/GHSA-jvx4-4wq7-6fmh - () https://github.com/samtools/htslib/security/advisories/GHSA-jvx4-4wq7-6fmh - Patch, Vendor Advisory

18 Mar 2026, 20:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-03-18 20:16

Updated : 2026-06-17 10:34


NVD link : CVE-2026-31971

Mitre link : CVE-2026-31971

CVE.ORG link : CVE-2026-31971


JSON object : View

Products Affected

htslib

  • htslib
CWE
CWE-121

Stack-based Buffer Overflow

CWE-122

Heap-based Buffer Overflow

CWE-787

Out-of-bounds Write

CWE-1284

Improper Validation of Specified Quantity in Input