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.
CVE-2026-25541 is an integer overflow vulnerability in the Bytes library's BytesMut::reserve function affecting versions 1.2.1 to 1.11.0, allowing attackers to cause undefined behavior through out-of-bounds memory access. The vulnerability occurs in release builds where unchecked addition can corrupt capacity values, potentially leading to memory corruption and system compromise.
تحتوي مكتبة Bytes على ثغرة تجاوز عدد صحيح في دالة BytesMut::reserve تؤثر على الإصدارات من 1.2.1 إلى 1.11.0. عند استخدام عملية جمع غير محققة، قد يؤدي التجاوز إلى تعيين قيمة سعة غير صحيحة تتجاوز الذاكرة المخصصة فعلياً. هذا يسمح بإنشاء شرائح خارج الحدود وقد يؤدي إلى سلوك غير محدد وتلف الذاكرة.
This vulnerability affects the Bytes utility library used in Rust applications, particularly those handling binary data processing. Organizations using vulnerable versions should immediately upgrade to 1.11.1 or later to prevent potential memory corruption attacks.
Upgrade the Bytes library to version 1.11.1 or later immediately. Review all applications using Bytes versions 1.2.1 through 1.11.0 and apply patches. Conduct security testing on affected systems to identify potential exploitation. Monitor system logs for unusual memory access patterns or application crashes.
قم بترقية مكتبة Bytes إلى الإصدار 1.11.1 أو أحدث فوراً. راجع جميع التطبيقات التي تستخدم إصدارات Bytes من 1.2.1 إلى 1.11.0 وطبق التصحيحات. أجرِ اختبارات أمان على الأنظمة المتأثرة. راقب سجلات النظام للكشف عن أنماط وصول الذاكرة غير العادية.