<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://db.gcve.eu/rss/recent/all/10</id>
  <title>Most recent entries from all</title>
  <updated>2026-11-21T15:00:53.377768+00:00</updated>
  <author>
    <name>Vulnerability-Lookup</name>
    <email>info@gcve.eu</email>
  </author>
  <link href="https://db.gcve.eu" rel="alternate"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="1.0.0">python-feedgen</generator>
  <subtitle>Contains only the most 10 recent entries.</subtitle>
  <entry>
    <id>https://db.gcve.eu/vuln/ghsa-434x-w66g-qw3r</id>
    <title>GHSA-434x-w66g-qw3r — bytes has integer overflow in BytesMut::reserve</title>
    <updated>2026-11-21T15:00:53.379310+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> crates.io: bytes</p>
<p># Details</p>
<p>In the unique reclaim path of `BytesMut::reserve`, the condition
```rs
if v_capacity &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.</p>
<p>This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.</p>
<p>## PoC</p>
<p>```rs
use bytes::*;</p>
<p>fn main() {
    let mut a = BytesMut::from(&amp;b"hello world"[..]);
    let mut b = a.split_off(5);</p>
<p>// Ensure b becomes the unique owner of the backing storage
    drop(a);</p>
<p>// Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);</p>
<p>// This call relies on the corrupted cap and may cause UB &amp; HBO
    b.put_u8(b'h');
}
```</p>
<p># Workarounds</p>
<p>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.</p>
<p>This vulnerability is also known as [RUSTSEC-2026-0007](https://rustsec.org/advisories/RUSTSEC-2026-0007.html).</p></div>
    </content>
    <link href="https://db.gcve.eu/vuln/ghsa-434x-w66g-qw3r"/>
  </entry>
</feed>
