HTSlib: Stack write overflow in HTSlib CRAM decoder
NIST has not reviewed this entry yet, so scores and affected versions may be missing or may change.
HTSlib is a library for reading and writing bioinformatics file formats. Prior to 1.21.2, 1.22.3, 1.23.2, and 1.24, the CRAM decoder validates the 254-character query-name limit only after decoding the name into a 1024-byte stack array. An attacker-controlled CRAM record can provide an overlong query name and overflow the local stack buffer before the later validation runs; all CRAM format versions are affected. Opening such a file can crash the process, corrupt stack data, and may permit arbitrary code execution. This issue is fixed in versions 1.21.2, 1.22.3, 1.23.2, and 1.24.
Stack-based Buffer Overflow CWE-121
Too much data overwrites memory the program uses to keep track of what to do next, which can let an attacker run their code.
The product writes past the end of a buffer that was allocated on the stack.
Weakness data: MITRE Common Weakness Enumeration.
Out-of-bounds Write CWE-787
The software writes data outside the space it was given. Attackers use this to run their own code or crash the program.
The product writes data past the end, or before the beginning, of the intended buffer.
Weakness data: MITRE Common Weakness Enumeration.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Samtools Htslib | Software | < 1.21.2; >= 1.22.0, < 1.22.3; >= 1.23.0, < 1.23.2 | not recorded |
The 8.8 severity score (high) from github.com, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | Network | Can be attacked from anywhere on the internet, with no need to be near the target. |
| How hard it is | Low | Easy to carry out. No special conditions have to line up. |
| Setup needed on the target | None | No special setup on the target is needed. |
| Login needed | None | The attacker does not need an account or password. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Data exposed | None | No data can be read. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | Low | The attacker can slow the service or interrupt it briefly. |
NIST lists 9 sources for this flaw, none tagged as a vendor patch.