CVE-2026-31968: HTSlib - Buffer Overflow
- Cve: CVE-2026-31968
- Name: HTSlib - Buffer Overflow
- 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. For the `VARINT` and `CONST` encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. 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.
- Impact: Attackers can cause crashes, data corruption, or potentially execute arbitrary code by opening crafted files.
- Remediation: Update to versions 1.23.1, 1.22.2, 1.21.1 or later.
- Vulnerability type: buffer_overflow
- Vulnerability impact: remote_code_execution, denial_of_service, data_tampering
- Requirement type: none
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 8.1
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
- Epss score: 0.00472
- Epss percentile: 0.41657
- Assignee: [email protected]
- Published at: 2026-03-18T20:16:21Z
- Age in days: 251
- Modified at: 2026-06-17T10:34:51Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-31968
- Nvd status: analyzed
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-121 | Stack-based Buffer Overflow |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/samtools/htslib/commit/0ec436796eca7b4ce7fcc9b77270c102da29bb2e | nvd | Patch |
| https://github.com/samtools/htslib/security/advisories/GHSA-cgcm-c9r2-p57j | nvd | Patch, Vendor Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| htslib:htslib | = 1.23; >= 1.22, < 1.22.2; < 1.21.1 | no | nvd | /v1/products/htslib/htslib |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| samtools/htslib | commit, fix, security_advisory | yes | /v1/repositories/samtools/htslib |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts