6.9medium
HTSlib CRAM decoder has a NULL Pointer Dereference
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.57% (higher than 41% 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 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| samtools htslib | < 1.21.1, >= 1.22, < 1.22.2, = 1.23 | CVE List |
| htslib htslib | before 1.21.1, from 1.22 before 1.22.2, 1.23 | NVD |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | 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 |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
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 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.
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 utilizando una variedad de codificaciones y métodos de compresión. Aunque la mayoría de los registros de alineación almacenan valores de secuencia de ADN y de calidad, el formato también permite omitir estos datos en ciertos casos para ahorrar espacio. Debido a algunas peculiaridades del formato CRAM, es necesario manejar estos registros con cuidado, ya que en realidad almacenarán datos que deben ser consumidos y luego descartados. Desafortunadamente, las codificaciones CONST, XPACK y XRLE no implementaron correctamente la interfaz necesaria para hacer esto. Intentar decodificar registros con datos de secuencia o calidad omitidos utilizando estas codificaciones resultaría en un intento de escribir en un puntero NULL. Explotar este error causa una desreferencia de puntero NULL. Típicamente, esto hará que el programa falle. 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.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31964 changed 2026-03-18 | CVE Terms of Use |
| NVD | CVE-2026-31964 changed 2026-06-17 | Public domain |