Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-25541 — bytes

🟠 CVSS 7.5 — High ⚠️ Exploit Public CWE-680 OSV
7.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

bytes has integer overflow in BytesMut::reserve

# Details

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.

This vulnerability is also known as [RUSTSEC-2026-0007](https://rustsec.org/advisories/RUSTSEC-2026-0007.html).

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity none, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: None — no deployment-specific condition has to hold.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: None.
  • Integrity impact: None.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-25541 is classified as CWE-680: Integer Overflow to Buffer Overflow. The product performs a calculation to determine how much memory to allocate, but an integer overflow can occur that causes less memory to be allocated than expected, leading to a buffer overflow.

Affected software

CVE-2026-25541 is recorded against 1 package.

  • bytes

Timeline and source

Published on 3 February 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)
github.com (Web)
rustsec.org (Web)

Same weakness in other software

These advisories are the same class of weakness (CWE-680: Integer Overflow to Buffer Overflow) in other software:

CVE-2026-25541 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 7.5
CVSS Vector CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
CWE CWE-680
Public Exploit ⚠️ Yes
Source OSV
Published 2026-02-03
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
bytes — —

Similar Threats

Exploit Protection

Are you running bytes?

CVE-2026-25541 carries CVSS 7.5 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-25541 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓