Skip to content

CVE-2026-25541 Bytes is vulnerable to integer overflow in BytesMut::reserve

MediumCVSS 5.5 EPSS 0.60%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

10 packages: 5 fixed, 5 with no fix yet.

PackageAffectedFixed inStatus
debian/rust-bytes(Debian 12) = 1.2.1-1; = 1.4.0-1; = 1.5.0-1; = 1.7.2-1 +7 more No fix listed No fix yet
debian/rust-bytes(Debian 13) = 1.9.0-1; = 1.10.1-1; = 1.11.0-1; = 1.11.1-1 +2 more No fix listed No fix yet
ubuntu/rust-bytes(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/rust-bytes(Ubuntu 24.04) All versions No fix listed No fix yet
ubuntu/rust-bytes(Ubuntu 26.04) All versions No fix listed No fix yet
azure linux rust-afterburn(Azure Linux 3.0) < 5.8.2-2 5.8.2-2 Fixed
azure linux trident(Azure Linux 3.0) < 0.22.0-1 0.22.0-1 Fixed
crates.io bytes(crates.io) >= 1.2.1, < 1.11.1 1.11.1 Fixed
debian/rust-bytes(Debian 14) < 1.11.1-1; = 1.9.0-1; = 1.10.1-1; = 1.11.0-1 1.11.1-1 Fixed
tokio-rs bytes = >= 1.2.1, < 1.11.1; >= 1.2.1, < 1.11.1 1.11.1 Fixed

Affected products

ProductAffected versionsFixed in
azure linux trident(Azure Linux:3.0) < 0.22.0-1 0.22.0-1
azure linux rust-afterburn(Azure Linux:3.0) < 5.8.2-2 5.8.2-2
crates.io bytes(crates.io) >= 1.2.1, < 1.11.1 1.11.1
tokio-rs bytes = >= 1.2.1, < 1.11.1 No fix listed
debian/rust-bytes(Debian:12) All versions No fix listed
debian/rust-bytes(Debian:12) = 1.10.1-1 No fix listed
debian/rust-bytes(Debian:12) = 1.11.0-1 No fix listed
debian/rust-bytes(Debian:12) = 1.11.1-1 No fix listed
debian/rust-bytes(Debian:12) = 1.12.1-1 No fix listed
debian/rust-bytes(Debian:12) = 1.2.1-1 No fix listed
debian/rust-bytes(Debian:12) = 1.4.0-1 No fix listed
debian/rust-bytes(Debian:12) = 1.5.0-1 No fix listed
debian/rust-bytes(Debian:12) = 1.7.2-1 No fix listed
debian/rust-bytes(Debian:12) = 1.8.0-1 No fix listed
debian/rust-bytes(Debian:12) = 1.9.0-1 No fix listed
debian/rust-bytes(Debian:13) All versions No fix listed
debian/rust-bytes(Debian:13) = 1.10.1-1 No fix listed
debian/rust-bytes(Debian:13) = 1.11.0-1 No fix listed
debian/rust-bytes(Debian:13) = 1.11.1-1 No fix listed
debian/rust-bytes(Debian:13) = 1.12.1-1 No fix listed
debian/rust-bytes(Debian:13) = 1.9.0-1 No fix listed
debian/rust-bytes(Debian:14) < 1.11.1-1 1.11.1-1
debian/rust-bytes(Debian:14) = 1.10.1-1 No fix listed
debian/rust-bytes(Debian:14) = 1.11.0-1 No fix listed
debian/rust-bytes(Debian:14) = 1.9.0-1 No fix listed
Show 4 more
ProductAffected versionsFixed in
ubuntu/rust-bytes(Ubuntu:22.04) All versions No fix listed
ubuntu/rust-bytes(Ubuntu:24.04) All versions No fix listed
ubuntu/rust-bytes(Ubuntu:26.04) All versions No fix listed
tokio-rs bytes >= 1.2.1, < 1.11.1 1.11.1

References