Skip to content

fix(boil,patchable): RUSTSEC-2026-0007 and 2026-0009#1434

Merged
sbernauer merged 1 commit intomainfrom
fix/rustsecs
Feb 26, 2026
Merged

fix(boil,patchable): RUSTSEC-2026-0007 and 2026-0009#1434
sbernauer merged 1 commit intomainfrom
fix/rustsecs

Conversation

@sbernauer
Copy link
Member

@sbernauer sbernauer commented Feb 26, 2026

Ci failed because of

https://rustsec.org/advisories/RUSTSEC-2026-0007
https://rustsec.org/advisories/RUSTSEC-2026-0009

Bumped all crates to their latest version

error[vulnerability]: Integer overflow in `BytesMut::reserve`
   ┌─ /home/sbernauer/stackable/docker-images/Cargo.lock:10:1
   │
10 │ bytes 1.10.1 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0007
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0007
   ├ In the unique reclaim path of `BytesMut::reserve`, the condition
     ```rs
     if v_capacity >= new_cap + offset
     ```
     uses an unchecked addition. When `new_cap + offset` overflows `usize` in release builds, this condition may incorrectly pass, causing `self.cap` to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as `spare_capacity_mut()` then trust this corrupted `cap` value and may create out-of-bounds slices, leading to UB.
     
     This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.
     
     ## PoC
     
     ```rs
     use bytes::*;
     
     fn main() {
         let mut a = BytesMut::from(&b"hello world"[..]);
         let mut b = a.split_off(5);
     
         // Ensure b becomes the unique owner of the backing storage
         drop(a);
     
         // Trigger overflow in new_cap + offset inside reserve
         b.reserve(usize::MAX - 6);
     
         // This call relies on the corrupted cap and may cause UB & HBO
         b.put_u8(b'h');
     }
     ```
     
     # Workarounds
     
     Users of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.
   ├ Announcement: https://github.com/advisories/GHSA-434x-w66g-qw3r
   ├ Solution: Upgrade to >=1.11.1 (try `cargo update -p bytes`)
   ├ bytes v1.10.1
     └── tokio v1.46.1
         └── boil v0.1.6

error[vulnerability]: Denial of Service via Stack Exhaustion
    ┌─ /home/sbernauer/stackable/docker-images/Cargo.lock:136:1
    │
136 │ time 0.3.41 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0009
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0009
    ├ ## Impact
      
      When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of
      service attack via stack exhaustion is possible. The attack relies on formally deprecated and
      rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary,
      non-malicious input will never encounter this scenario.
      
      ## Patches
      
      A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned
      rather than exhausting the stack.
      
      ## Workarounds
      
      Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of
      the stack consumed would be at most a factor of the length of the input.
    ├ Announcement: https://github.com/time-rs/time/blob/main/CHANGELOG.md#0347-2026-02-05
    ├ Solution: Upgrade to >=0.3.47 (try `cargo update -p time`)
    ├ time v0.3.41
      ├── boil v0.1.6
      └── patchable v0.1.0

advisories FAILED, bans ok, licenses ok, sources ok

@sbernauer sbernauer self-assigned this Feb 26, 2026
@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Feb 26, 2026
@Techassi Techassi changed the title fix: RUSTSEC-2026-0007 and 2026-0009 by bumping Rust dependencies fix(boil,patchable): RUSTSEC-2026-0007 and 2026-0009 Feb 26, 2026
@Techassi Techassi moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Feb 26, 2026
@sbernauer sbernauer added this pull request to the merge queue Feb 26, 2026
@sbernauer sbernauer moved this from Development: In Review to Development: Done in Stackable Engineering Feb 26, 2026
Merged via the queue into main with commit 8b84d2c Feb 26, 2026
8 checks passed
@sbernauer sbernauer deleted the fix/rustsecs branch February 26, 2026 13:14
@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants