CVE-2026-31962: HTSlib CRAM reader has heap buffer overflow due to improper validation of input

Published Mar 18, 2026
·
Updated

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 cramdecodeseq() 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.

Affected Software

5 affected components
HTSlib<1.21.1
HTSlib>=undefined
HTSlib HTSlib<1.21.1
HTSlib HTSlib>=1.22<1.22.2
HTSlib HTSlib=1.23

Event History

Mar 18, 2026
CVE Published
via MITRE·06:08 PM
Data Sourced
via MITRE·06:08 PM
DescriptionWeakness
Data Sourced
via NVD·06:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-31962?

CVE-2026-31962 is classified as a high severity vulnerability due to the potential for a heap buffer overflow.

2

How do I fix CVE-2026-31962?

To fix CVE-2026-31962, update HTSlib to version 1.21.2 or later to address the buffer overflow issue.

3

What impact does CVE-2026-31962 pose on HTSlib users?

CVE-2026-31962 can lead to remote code execution or application crashes if exploited, affecting users handling DNA sequence alignment data.

4

Which versions of HTSlib are affected by CVE-2026-31962?

HTSlib versions up to and including 1.21.1 are affected by CVE-2026-31962.

5

Is there a risk of data loss associated with CVE-2026-31962?

Yes, exploitation of CVE-2026-31962 could potentially lead to data corruption or loss during processing.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203