CVE-2026-31970
Beskrivelse
HTSlib is a library for reading and writing bioinformatics file formats. GZI files are used to index block-compressed GZIP [BGZF] files. In the GZI loading function, `bgzf_index_load_hfile()`, it was possible to trigger an integer overflow, leading to an under- or zero-sized buffer being allocated to store the index. Sixteen zero bytes would then be written to this buffer, and, depending on the result of the overflow the rest of the file may also be loaded into the buffer as well. If the function did attempt to load the data, it would eventually fail due to not reading the expected number of records, and then try to free the overflowed heap buffer. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by 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. The easiest work-around is to discard any `.gzi` index files from untrusted sources, and use the `bgzip -r` option to recreate them.
Beskrivelsen gjengis slik kilden har publisert den, på engelsk.
Nøkkelfakta
- Publisert
- 2026-03-18
- Sist endret
- 2026-06-17
- Tildelt av
- security-advisories@github.com
- CVSS-vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H- Scoret av
- nvd@nist.gov (NVD Primary)
- Sannsynlighet for utnyttelse
-
0.5 %
høyere enn 37 %
av alle kjente sårbarheter
EPSS, neste 30 dager, modell v2026.06.15 - Rettelse finnes
- Ja, se referansene
Berørte produkter
| Leverandør | Produkt | Versjoner | Status |
|---|---|---|---|
| Htslib | Htslib | < 1.21 | Berørt |
| Htslib | Htslib | 1.23 | Berørt |
| Htslib | Htslib | ≥ 1.22, < 1.22.2 | Berørt |
Svakhetstype
-
CWE-122: Heap-based Buffer Overflow
The product writes past the end of a buffer that was allocated on the heap.
-
CWE-1284: Improper Validation of Specified Quantity in Input
The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.
-
CWE-131: Incorrect Calculation of Buffer Size
The product does not correctly calculate the size to be used when allocating a buffer.
-
CWE-190: Integer Overflow or Wraparound
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is i…
-
CWE-787: Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
Referanser
- https://github.com/samtools/htslib/commit/6dd0d7d0e9e7e2e173a28969e624db8bc8bb5828
- https://github.com/samtools/htslib/security/advisories/GHSA-p345-84hx-fq6q
- http://www.openwall.com/lists/oss-security/2026/03/18/9
Berører dette dere?
En sårbarhet betyr bare noe hvis dere kjører produktet, i en berørt versjon, et sted en angriper kommer til.