Heap-buffer-overflow in uint7_get_64 in htslib
Summary
OSV-2023-837: Heap-buffer-overflow in uint7_get_64. Affects htslib versions >= 9c7e845e25cdb899cd833e96a46ef7d6dd8fb6be, < 28a980bba6f731f901906f57e5c1ee19f4155849. Fixed in 28a980bba6f731f901906f57e5c1ee19f4155849. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
htslib is an open-source library for manipulating high-throughput sequencing data formats. It provides a set of utility functions and data structures for working with various file formats commonly used in genomics. The library is widely used in bioinformatics and genomics research to process and analyze sequencing data. Unfortunately, htslib is susceptible to a heap-buffer-overflow vulnerability in the function uint7_get_64.
Vulnerability Detail
The vulnerability in htslib arises from a heap-buffer-overflow issue in the uint7_get_64 function. This vulnerability can be triggered when the function attempts to read more data from a buffer than is available, leading to a buffer overflow. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition. The vulnerability was discovered through an OSS-Fuzz report and has been assigned a medium severity level.
How To Fix
Minimum fixed version
28a980bba6f731f901906f57e5c1ee19f4155849
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a workaround, it is advised to avoid processing untrusted input using the affected function until the library has been updated with the fix. By refraining from using the vulnerable function, the risk of exploitation can be mitigated. Here is an example of how to avoid using the vulnerable function:
// Code snippet demonstrating the workaround
if (!is_untrusted_input) {
uint64_t value = uint7_get_64(buffer);
// Continue processing the value
}
Conclusion
In conclusion, htslib is vulnerable to a heap-buffer-overflow in the uint7_get_64 function. This vulnerability can be mitigated by updating htslib to a version that includes the fix or by avoiding the use of the vulnerable function until the library has been updated. For further support or assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for htslib →
FAQ
htslib is an open-source library used for manipulating high-throughput sequencing data formats. It provides utility functions and data structures for working with genomics file formats.
A heap-buffer-overflow vulnerability occurs when a program tries to read or write data outside the bounds of a buffer allocated in the heap. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code.
This vulnerability was discovered through an OSS-Fuzz report, which is a continuous fuzzing service for open-source software. The report identified the specific function and code path where the vulnerability exists.
This vulnerability has been assigned a medium severity level. While it has the potential for exploitation, it may require certain conditions or user interaction to be successfully exploited.
You can use Vulert, a vulnerability monitoring service, to check if your application is affected by this vulnerability. Vulert analyzes manifest files like package-lock.json to identify and alert for open-source vulnerabilities in your software.
References
Related vulnerabilities
Recent vulnerabilities recorded for htslib.