Bytes is vulnerable to integer overflow in BytesMut::reserve
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- —
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| tokio-rs | bytes | 1.2.1 to before 1.11.1 | 1.11.1 | Patch available | CNA |
| — | bytes (crates.io) | 1.2.1 to before 1.11.1 | 1.11.1 | Patch available | GHSA-434x-w66g-qw3r |
- bytes Vendortokio-rs Affected 1.2.1 to before 1.11.1 Fixed in 1.11.1 Patch available CNA
- bytes (crates.io) Vendor— Affected 1.2.1 to before 1.11.1 Fixed in 1.11.1 Patch available GHSA-434x-w66g-qw3r
Remediation
- Fix · CNA bytes (tokio-rs) Fixed in 1.11.1
- Fix · GHSA-434x-w66g-qw3r bytes (crates.io) Fixed in 1.11.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-25541
- 2026-10-03 Alias added: GHSA-434x-w66g-qw3r
References
Exploit 2
Sources
- CVE-2026-25541 · CVE Program
- CVE-2026-25541 · NVD
- FIRST EPSS
- GHSA-434x-w66g-qw3r · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences