
Cloud Vulnerability DB
A community-led vulnerabilities database
An issue was discovered in the bam crate before 0.1.3 for Rust. There is an integer underflow and out-of-bounds write vulnerability during the loading of a bgzip block. The vulnerability was reported on January 7, 2021, and publicly disclosed on March 1, 2021 (RustSec Advisory).
The vulnerability occurs in the bam::bgzip::Block::load function. When setting the length of an internal buffer using self.compressed.set_len(block_size - HEADER_SIZE - MIN_EXTRA_SIZE), while block_size was properly constrained to a maximum value, if it was too small the subtraction could overflow negatively to a large number past the capacity of self.compressed. This results in memory corruption through out-of-bounds writes when loading a bgzip file with a small block_size. The vulnerability has been assigned a CVSS v3.1 score of 9.8 CRITICAL (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) (RustSec Advisory).
The vulnerability can lead to memory corruption through out-of-bounds writes, potentially allowing attackers to execute arbitrary code or cause system crashes. Given the CVSS score of 9.8, this vulnerability is considered critical with high impacts on confidentiality, integrity, and availability (RustSec Advisory).
The vulnerability can be triggered by providing a specially crafted bgzip file with a small block_size value that causes integer underflow. The attack requires no special privileges or user interaction and can be executed remotely over a network (RustSec Advisory).
The vulnerability was fixed in version 0.1.3 of the bam crate through commit 061eee38d4, which added checks for underflow when setting the buffer size. Users should upgrade to version 0.1.3 or later to address this vulnerability (RustSec Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."