CVE-2021-28027
Rust vulnerability analysis and mitigation

Overview

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

Technical details

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

Impact

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

Exploitability

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

Mitigation and workarounds

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

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-53530HIGH8.7
  • Rust logoRust
  • ratex-parser
NoYesAug 21, 2026
CVE-2026-53531MEDIUM6.9
  • Rust logoRust
  • ratex-parser
NoYesAug 21, 2026
GHSA-mc9m-6fm9-pghcMEDIUM6.9
  • Python logoPython
  • zoo-kcl
NoYesAug 20, 2026
GHSA-jgvr-6x5w-hx5wMEDIUM6.9
  • Python logoPython
  • kcl-lib
NoYesAug 20, 2026
CVE-2026-54136MEDIUM5.1
  • Rust logoRust
  • windmill-api
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management