<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://db.gcve.eu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Sat, 21 Nov 2026 15:00:53 +0000</lastBuildDate>
    <item>
      <title>GHSA-434x-w66g-qw3r — bytes has integer overflow in BytesMut::reserve</title>
      <link>https://db.gcve.eu/vuln/ghsa-434x-w66g-qw3r</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; crates.io: bytes&lt;/p&gt;
&lt;p&gt;# Details&lt;/p&gt;
&lt;p&gt;In the unique reclaim path of `BytesMut::reserve`, the condition
```rs
if v_capacity &amp;gt;= 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.&lt;/p&gt;
&lt;p&gt;This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.&lt;/p&gt;
&lt;p&gt;## PoC&lt;/p&gt;
&lt;p&gt;```rs
use bytes::*;&lt;/p&gt;
&lt;p&gt;fn main() {
    let mut a = BytesMut::from(&amp;amp;b&amp;#34;hello world&amp;#34;[..]);
    let mut b = a.split_off(5);&lt;/p&gt;
&lt;p&gt;// Ensure b becomes the unique owner of the backing storage
    drop(a);&lt;/p&gt;
&lt;p&gt;// Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);&lt;/p&gt;
&lt;p&gt;// This call relies on the corrupted cap and may cause UB &amp;amp; HBO
    b.put_u8(b&amp;#39;h&amp;#39;);
}
```&lt;/p&gt;
&lt;p&gt;# Workarounds&lt;/p&gt;
&lt;p&gt;Users of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.&lt;/p&gt;
&lt;p&gt;This vulnerability is also known as [RUSTSEC-2026-0007](https://rustsec.org/advisories/RUSTSEC-2026-0007.html).&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; crates.io: bytes&lt;/p&gt;
&lt;p&gt;# Details&lt;/p&gt;
&lt;p&gt;In the unique reclaim path of `BytesMut::reserve`, the condition
```rs
if v_capacity &amp;gt;= 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.&lt;/p&gt;
&lt;p&gt;This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.&lt;/p&gt;
&lt;p&gt;## PoC&lt;/p&gt;
&lt;p&gt;```rs
use bytes::*;&lt;/p&gt;
&lt;p&gt;fn main() {
    let mut a = BytesMut::from(&amp;amp;b&amp;#34;hello world&amp;#34;[..]);
    let mut b = a.split_off(5);&lt;/p&gt;
&lt;p&gt;// Ensure b becomes the unique owner of the backing storage
    drop(a);&lt;/p&gt;
&lt;p&gt;// Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);&lt;/p&gt;
&lt;p&gt;// This call relies on the corrupted cap and may cause UB &amp;amp; HBO
    b.put_u8(b&amp;#39;h&amp;#39;);
}
```&lt;/p&gt;
&lt;p&gt;# Workarounds&lt;/p&gt;
&lt;p&gt;Users of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.&lt;/p&gt;
&lt;p&gt;This vulnerability is also known as [RUSTSEC-2026-0007](https://rustsec.org/advisories/RUSTSEC-2026-0007.html).&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/ghsa-434x-w66g-qw3r</guid>
    </item>
  </channel>
</rss>
