CVE-2026-25541 Details
Description
Bytes is a utility library for working with bytes. From version 1.2.1 to before 1.11.1, Bytes is vulnerable to integer overflow in BytesMut::reserve. In the unique reclaim path of BytesMut::reserve, if the condition "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. This issue has been patched in version 1.11.1.
A vulnerability exists in the Bytes library, specifically in the BytesMut::reserve function, versions 1.2.1 prior to 1.11.1. The issue arises from an integer overflow in the unique reclaim path of the reserve function. The condition that checks vector capacity uses an unchecked addition, which can lead to an incorrect capacity value being set. This corrupted value can then be trusted by subsequent APIs, potentially creating out-of-bounds slices and causing undefined behavior. This vulnerability is present in release builds, where the integer overflow wraps, while debug builds correctly panic due to overflow checks.
Users should upgrade to Bytes version 1.11.1 or later, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 5, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/tokio-rs/bytes/commit/d0293b0e35838123c51ca5dfdf468ecafee4398f | [email protected] | Patch |
| https://github.com/tokio-rs/bytes/releases/tag/v1.11.1 | [email protected] | ProductRelease Notes |
| https://github.com/tokio-rs/bytes/security/advisories/GHSA-434x-w66g-qw3r | [email protected] | ExploitVendor Advisory |
| https://rustsec.org/advisories/RUSTSEC-2026-0007.html | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-680 | Integer Overflow to Buffer Overflow | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| tokio-rs bytes | >= 1.2.1, < 1.11.1 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Feb 27, 2026 | Initial Analysis | [email protected] |
| Feb 4, 2026 | New CVE Received | [email protected] |