Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-25541: CWE-680: Integer Overflow to Buffer Overflow in tokio-rs bytes

0
Medium
VulnerabilityCVE-2026-25541cvecve-2026-25541cwe-680
Published: Wed Feb 04 2026 (02/04/2026, 22:03:53 UTC)
Source: CVE Database V5
Vendor/Project: tokio-rs
Product: bytes

Description

CVE-2026-25541 is a medium severity integer overflow vulnerability in the tokio-rs bytes library versions 1. 2. 1 to before 1. 11. 1. The flaw occurs in the BytesMut::reserve function where unchecked addition can cause an integer overflow, leading to a buffer overflow and undefined behavior in release builds. This can corrupt internal capacity tracking and cause out-of-bounds memory access. The vulnerability does not require authentication or user interaction but has a local attack vector. It has been patched in version 1. 11.

AI-Powered Analysis

AILast updated: 02/04/2026, 22:30:09 UTC

Technical Analysis

The vulnerability CVE-2026-25541 affects the bytes library, a utility for byte manipulation widely used in Rust applications, particularly those leveraging the tokio-rs asynchronous runtime. Between versions 1.2.1 and before 1.11.1, the BytesMut::reserve method contains an unchecked addition operation when calculating new capacity (new_cap + offset). In release builds, integer overflow in this addition wraps around due to the lack of overflow checks, causing the condition 'v_capacity >= new_cap + offset' to incorrectly evaluate as true. This leads to self.cap being set to a value larger than the actually allocated buffer capacity. Subsequent API calls such as spare_capacity_mut() rely on this corrupted capacity value, resulting in out-of-bounds slice creation and undefined behavior, including potential memory corruption or crashes. Debug builds do not exhibit this issue as they panic on overflow. The vulnerability is classified under CWE-680 (Integer Overflow to Buffer Overflow). Exploitation does not require privileges or user interaction but is limited to local code execution contexts where the vulnerable library is used. The issue was addressed by adding proper overflow checks and capacity validations in version 1.11.1 of the bytes library.

Potential Impact

For European organizations, the impact of this vulnerability depends on the usage of the tokio-rs bytes library within their Rust-based infrastructure, which is common in modern asynchronous applications, microservices, and networked systems. Exploitation could lead to memory corruption, application crashes, or potentially arbitrary code execution if an attacker can influence the input parameters to BytesMut::reserve. This can compromise confidentiality, integrity, and availability of affected services. Given the local attack vector and no requirement for user interaction, exploitation is more likely in environments where untrusted code or data can reach the vulnerable library, such as multi-tenant platforms or services processing external inputs. The medium CVSS score reflects moderate risk, but the potential for denial of service or memory corruption in critical infrastructure components could have significant operational impacts. Organizations relying on Rust-based tooling or services should assess their dependency trees and update promptly to avoid exploitation.

Mitigation Recommendations

1. Immediately upgrade the bytes library to version 1.11.1 or later where the vulnerability is patched. 2. Audit all Rust projects and dependencies to identify usage of vulnerable bytes versions, including transitive dependencies, using tools like cargo-audit. 3. Implement strict input validation and sanitization in applications that use BytesMut::reserve to reduce the risk of triggering the overflow condition. 4. Employ memory safety and runtime protection mechanisms such as AddressSanitizer during development and testing to detect out-of-bounds accesses. 5. For critical production environments, consider additional runtime monitoring for abnormal crashes or memory corruption symptoms. 6. Educate developers on safe handling of capacity calculations and the importance of using updated libraries. 7. If upgrading is not immediately feasible, consider applying temporary patches or workarounds that add explicit overflow checks before capacity calculations.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-02T19:59:47.375Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6983c4edf9fa50a62fb05c7f

Added to database: 2/4/2026, 10:15:09 PM

Last enriched: 2/4/2026, 10:30:09 PM

Last updated: 2/5/2026, 3:33:28 AM

Views: 11

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats