Heap-buffer-overflow in uint7_get_64 in htslib

htslib Updated 02 Oct 2025

Summary

12/09/2023
MEDIUM
Yes i
Medium
Not published

OSV-2023-837: Heap-buffer-overflow in uint7_get_64. Affects htslib versions >= 9c7e845e25cdb899cd833e96a46ef7d6dd8fb6be, < 28a980bba6f731f901906f57e5c1ee19f4155849. Fixed in 28a980bba6f731f901906f57e5c1ee19f4155849. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for htslib.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback