Skip to main content

smallbitvec CVE-2026-44983

HIGH
Heap-based Buffer Overflow (CWE-122)
2026-05-09 https://github.com/servo/smallbitvec GHSA-97wc-2hqc-cjgr
7.3
CVSS 3.1 · Vendor: https://github.com/servo/smallbitvec
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply malicious capacity near usize::MAX
  2. Delivery
    Trigger integer overflow in buffer_len calculation
  3. Exploit
    Allocate undersized heap buffer
  4. Execution
    Perform safe API operation (set/push/reserve)
  5. Persist
    Access out-of-bounds memory via corrupted metadata
  6. Impact
    Achieve heap buffer overflow

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the application to accept attacker-controlled or attacker-influenced input that determines the capacity parameter passed to SmallBitVec construction or reservation methods (from_elem, with_capacity, reserve, or reserve_exact). The malicious capacity value must be close to usize::MAX (specifically, values where cap + bits_per_storage() - 1 overflows usize, approximately cap >= usize::MAX - 63 on typical platforms where bits_per_storage returns 64). The application must be compiled in release mode with default Rust overflow semantics (wrapping) rather than overflow-checks enabled. Exploitation is NOT limited to applications containing unsafe code blocks - the vulnerability manifests entirely through safe APIs, which is the defining characteristic making this severe in Rust's threat model. Limiting factors include: requires local attack vector or ability to influence application logic (cannot exploit remotely without application-level vulnerability accepting malicious capacity values), and the application must actually use the smallbitvec crate. Applications that only use smallbitvec with hardcoded or bounded capacity values are not exploitable.

Impact

The CVSS score of 7.3 (AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H) indicates local exploitation with low complexity and no privileges required, resulting in high availability impact and low confidentiality/integrity impact. However, real-world risk assessment reveals nuanced factors. The local attack vector (AV:L) significantly limits remote exploitation scenarios, requiring local code execution capability or the ability to influence application input to supply malicious capacity values. Attack complexity is genuinely low (AC:L) as demonstrated by two working proof-of-concept exploits requiring only standard API calls. No public exploit identified at time of analysis beyond the GitHub advisory POCs. EPSS data not provided, but the Rust ecosystem's rapid patching culture and cargo audit tooling typically limit widespread exploitation windows. The critical distinguishing factor is violation of Rust's memory safety model through safe APIs - this affects the trust model for Rust applications and could enable privilege escalation in sandboxed contexts that permit safe Rust but restrict unsafe code. The vulnerability is highly automatable for scanning (any code passing usize::MAX or near-maximum values to from_elem/reserve), but exploitation requires application logic that accepts attacker-controlled capacity parameters. No vendor-released patch identified at time of analysis - GitHub advisory confirms affected versions 1.0.1-2.6.0 with no fixed version listed, indicating active vulnerability in all current releases. Defenders should prioritize if applications use smallbitvec and accept external input for collection sizing.

Exploit ScenarioDerived

An attacker with local code execution or the ability to influence application input supplies a malicious capacity parameter approaching usize::MAX to a SmallBitVec allocation function. For example, a web service using smallbitvec to cache bit flags per user might accept a malicious user_count parameter of usize::MAX - 10. When the application calls SmallBitVec::from_elem(malicious_capacity, false), the internal buffer_len calculation overflows, allocating only a tiny heap buffer while metadata records the massive logical capacity. Subsequent legitimate operations like v.set(attacker_controlled_index, true) perform out-of-bounds writes to arbitrary heap memory. The attacker achieves heap corruption through pure safe Rust APIs, potentially enabling control-flow hijacking, information disclosure from adjacent heap objects, or denial-of-service crashes, all while evading security mechanisms that restrict unsafe code.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 09, 2026

Integer overflow in Rust crate smallbitvec allows heap buffer overflow through safe API calls when capacity values approach usize::MAX. The vulnerability affects versions 1.0.1 through 2.6.0 and enables memory corruption without requiring unsafe code blocks, violating Rust's memory safety guarantees. Publicly available exploit code exists with working proof-of-concept demonstrating ASAN-detectable heap corruption. CVSS 7.3 reflects local attack vector, but the vulnerability is notable because it breaks Rust's core safety model by achieving undefined behavior through safe APIs alone.

RemediationAI

No vendor-released patch identified at time of analysis - the GitHub advisory (GHSA-97wc-2hqc-cjgr) lists vulnerable versions 1.0.1-2.6.0 with no fixed version specified, indicating the maintainers have not yet released a patched version. Organizations using smallbitvec should implement immediate compensating controls: (1) Add input validation to reject capacity values exceeding a reasonable maximum (e.g., cap > isize::MAX or cap > 1GB worth of bits) before passing to SmallBitVec::from_elem(), reserve(), or with_capacity() - this prevents the overflow trigger but may break legitimate use cases requiring very large bit vectors. (2) Review all call sites where external input influences SmallBitVec capacity parameters and implement strict bounds checking. (3) Consider migrating to alternative crates such as bitvec or bit-vec that have active maintenance and no known similar vulnerabilities, though migration requires code changes and testing. (4) Enable overflow checks in release builds via RUSTFLAGS="-C overflow-checks=on" during compilation - this converts wrapping overflow to panic, preventing memory corruption but causing denial-of-service when overflow occurs (acceptable trade-off for memory safety). Monitor the GitHub advisory and crates.io for patched releases. Until a fix is available, the most practical mitigation for most applications is input validation limiting capacity to safe maximums with explicit error handling.

Affected Packages

cargo smallbitvec no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The smallbitvec crate provides a compact bit vector implementation for Rust. The vulnerability resides in an internal capacity calculation helper that uses unchecked arithmetic: (cap + bits_per_storage() - 1) / bits_per_storage(). In Rust release builds, integer overflow follows wrapping semantics by default rather than panicking. When capacity values near usize::MAX are provided, the addition wraps around to a small value, causing buffer_len() to return an undersized allocation requirement. The crate then allocates insufficient heap memory while maintaining metadata (logical length/capacity) that reflects the original large size. Subsequent safe API operations like set(), push(), and reserve() rely on this corrupted metadata for bounds checking, but the actual unsafe pointer arithmetic and indexing in the implementation accesses memory beyond the allocated buffer. This represents a CWE-122 heap-based buffer overflow triggered through an integer overflow (CWE-190) in safe code, which is particularly severe in Rust's memory-safe ecosystem where such violations are expected to require explicit unsafe blocks.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/servo/smallbitvec) PRIMARY 7.3 HIGH
AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

Primary rating from Vendor (https://github.com/servo/smallbitvec) · only source for this CVE.

CVSS VectorVendor: https://github.com/servo/smallbitvec

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
High

DescriptionCVE.org

Summary

An integer overflow in the internal capacity calculation of smallbitvec can lead to an undersized heap allocation, resulting in a heap buffer overflow through safe APIs only. This allows memory corruption without requiring unsafe code from the caller.

Details

The issue originates from unchecked arithmetic in the internal helper function responsible for computing the required buffer size:

(cap + bits_per_storage() - 1) / bits_per_storage()

When cap is close to usize::MAX, the addition:

cap + bits_per_storage() - 1

can overflow in release builds and wrap around due to Rust’s default wrapping semantics for integer overflow in optimized builds.

As a result:

  • buffer_len(cap) may return a value significantly smaller than required.
  • The backing storage is allocated with insufficient size.
  • Internal metadata (logical length/capacity) reflects a much larger size than the actual allocation.

Subsequent safe API calls (e.g., set, push, reserve) rely on this corrupted metadata and perform index computations that assume sufficient backing storage. These operations eventually reach unsafe internal code paths (e.g., pointer arithmetic and unchecked indexing), leading to out-of-bounds memory access.

Summary of the issue: integer overflow → undersized allocation → inconsistent metadata (len/cap vs actual buffer) → unsafe internal access using corrupted metadata → heap buffer overflow (UB)

PoC

PoC 1: Out-of-bounds write via from_elem
rust
#![forbid(unsafe_code)]

use smallbitvec::SmallBitVec;

fn main() {
    // Triggers overflow in buffer_len(cap)
    let mut v = SmallBitVec::from_elem(usize::MAX, false);

    // Logical length is large, but backing storage is undersized
    // This leads to out-of-bounds write in unsafe internals
    v.set(0, true);
}
PoC 2: Overflow via reserve
rust
#![forbid(unsafe_code)]

use smallbitvec::SmallBitVec;

fn main() {
    let mut v = SmallBitVec::new();
    v.push(true);

    // Triggers overflow in capacity computation
    v.reserve(usize::MAX - 10);
}

Impact

  • Heap buffer overflow via safe API only
  • ASAN-observable heap-buffer-overflow
  • Undefined Behavior detectable with Miri (e.g., out-of-bounds indexing due to corrupted metadata)

Tested on

  • rustc 1.96.0-nightly (9602bda1d 2026-04-05)
  • Target: x86_64-unknown-linux-gnu
  • Build: release
  • ASAN: RUSTFLAGS="-Z sanitizer=address" cargo +nightly run --release
  • Miri: cargo +nightly miri run --release

Executive ViewAI

Why It Matters

CVE-2026-44983 affects the Rust smallbitvec library (versions 1.0.1-2.6.0) and enables heap buffer overflow through legitimate API calls, allowing attackers to corrupt memory and potentially execute arbitrary code without requiring direct unsafe code usage. Organizations using smallbitvec in production services-particularly those handling untrusted input or running multi-tenant workloads-face immediate risk of application crashes, data corruption, or privilege escalation depending on deployment context. This vulnerability is critical because it undermines Rust's memory safety guarantees, the primary security advantage of the language, and requires urgent inventory and mitigation.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict smallbitvec usage to operations with bounded, pre-validated input sizes well below usize::MAX; (2) implement input sanitization to enforce capacity limits; (3) run affected services in sandboxed/containerized environments with memory-access monitoring; (4) consider pinning to unaffected versions (1.0.0 or lower) if feasible; (5) evaluate alternative bitvector crates without this vulnerability as temporary replacement if mission-critical. Monitor vendor advisories and Rust security mailing list for patch availability.

Threat Intelligence Overview

EPSS Score
0.0%
Top 100% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.

Affected Products (CPE)CVE.org

pkg:rust/smallbitvec

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy