CVE-2026-31962

Source
https://cve.org/CVERecord?id=CVE-2026-31962
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31962.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-31962
Aliases
  • GHSA-xxmp-v7h3-gpwp
Downstream
Published
2026-03-18T18:08:26.067Z
Modified
2026-04-10T05:42:53.854758Z
Severity
  • 8.8 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N CVSS Calculator
Summary
HTSlib CRAM reader has heap buffer overflow due to improper validation of input
Details

HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. 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 cram_decode_seq() did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. 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. There is no workaround for this issue.

Database specific
{
    "cwe_ids": [
        "CWE-122",
        "CWE-125",
        "CWE-129",
        "CWE-787"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31962.json",
    "cna_assigner": "GitHub_M"
}
References

Affected packages

Git / github.com/samtools/htslib

Affected ranges

Type
GIT
Repo
https://github.com/samtools/htslib
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Last affected
Database specific
{
    "versions": [
        {
            "introduced": "0"
        },
        {
            "fixed": "1.21.1"
        },
        {
            "last_affected": "= 1.23"
        }
    ]
}
Type
GIT
Repo
https://github.com/samtools/htslib
Events
Database specific
{
    "versions": [
        {
            "introduced": "1.22"
        },
        {
            "fixed": "1.22.2"
        }
    ]
}

Affected versions

0.*
0.2.0-rc10
0.2.0-rc11
0.2.0-rc12
0.2.0-rc2
0.2.0-rc3
0.2.0-rc4
0.2.0-rc5
0.2.0-rc6
0.2.0-rc7
0.2.0-rc8
0.2.0-rc9
1.*
1.0
1.1
1.10
1.10.1
1.10.2
1.11
1.11.0
1.12
1.13
1.14
1.15
1.15.1
1.16
1.17
1.18
1.19
1.19.1
1.2
1.2.1
1.20
1.21
1.22
1.22.1
1.23
1.3
1.3.1
1.3.2
1.4
1.4.1
1.5
1.6
1.7
1.8
1.9
Other
stable1
stable2
vcf-direct-final

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31962.json"