Update gh-pages

This commit is contained in:
github-actions
2026-04-21 07:33:32 +00:00
parent bd54e3282a
commit 614a440975
13 changed files with 936 additions and 192 deletions
+342
View File
@@ -0,0 +1,342 @@
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="author" content="Rust Project Developers">
<meta name="description" content="Security advisory database for Rust crates published through https://crates.io">
<title>RUSTSEC-2026-0103: thin-vec: Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics › RustSec Advisory Database</title>
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,300italic,400italic" rel="stylesheet">
<link href="/css/basic.css" rel="stylesheet">
<link href="/css/highlight.css" rel="stylesheet">
<link href="/css/index.css" rel="stylesheet">
<script src="/js/index.js" defer></script>
<script src="/js/search.js" defer></script>
<header>
<div class="header-top">
<h1><a href="/">
<picture>
<source srcset="/img/rustsec-logo-light.svg" media="(prefers-color-scheme: light)">
<img src="/img/rustsec-logo-dark.svg" alt="RustSec logo" class="logo-image">
</picture>
</a></h1>
<div class="search">
<form onsubmit="return searchform();">
<input type="search" id="search-term"
placeholder="Look up package or ID..." required
size="20">
</form>
</div>
</div>
<nav>
<div>
<a href="/">About</a>
<a href="/advisories/">Advisories</a>
<a href="/contributing.html">Report Vulnerabilities</a>
</div>
<div>
<a href="https://rust-lang.zulipchat.com/login/#narrow/stream/146229-wg-secure-code/" title="Zulip" aria-label="Zulip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height:1em;fill:currentColor"><path d="M473.09 122.97c0 22.69-10.19 42.85-25.72 55.08L296.61 312.69c-2.8 2.4-6.44-1.47-4.42-4.7l55.3-110.72c1.55-3.1-.46-6.91-3.64-6.91H129.36c-33.22 0-60.4-30.32-60.4-67.37 0-37.06 27.18-67.37 60.4-67.37h283.33c33.22-.02 60.4 30.3 60.4 67.35zM129.36 506.05h283.33c33.22 0 60.4-30.32 60.4-67.37 0-37.06-27.18-67.37-60.4-67.37H198.2c-3.18 0-5.19-3.81-3.64-6.91l55.3-110.72c2.02-3.23-1.62-7.1-4.42-4.7L94.68 383.6c-15.53 12.22-25.72 32.39-25.72 55.08 0 37.05 27.18 67.37 60.4 67.37zm522.5-124.15l124.78-179.6v-1.56H663.52v-48.98h190.09v34.21L731.55 363.24v1.56h124.01v48.98h-203.7V381.9zm338.98-230.14V302.6c0 45.09 17.1 68.03 47.43 68.03 31.1 0 48.2-21.77 48.2-68.03V151.76h59.09V298.7c0 80.86-40.82 119.34-109.24 119.34-66.09 0-104.96-36.54-104.96-120.12V151.76h59.48zm244.91 0h59.48v212.25h104.18v49.76h-163.66V151.76zm297 0v262.01h-59.48V151.76h59.48zm90.18 3.5c18.27-3.11 43.93-5.44 80.08-5.44 36.54 0 62.59 7 80.08 20.99 16.72 13.22 27.99 34.99 27.99 60.64 0 25.66-8.55 47.43-24.1 62.2-20.21 19.05-50.15 27.6-85.13 27.6-7.77 0-14.77-.39-20.21-1.17v93.69h-58.7V155.26zm58.7 118.96c5.05 1.17 11.27 1.55 19.83 1.55 31.49 0 50.92-15.94 50.92-42.76 0-24.1-16.72-38.49-46.26-38.49-12.05 0-20.21 1.17-24.49 2.33v77.37z"/></svg></a>
<a href="https://twitter.com/RustSec/" title="Twitter" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height:1em;fill:currentColor"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
<a href="https://github.com/RustSec/" title="GitHub" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" style="height:1em;fill:currentColor"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg></a>
<a href="/feed.xml" title="Atom Feed" aria-label="Atom Feed"><svg xmlns="http://www.w3.org/2000/svg" style="height:1em" viewBox="0 0 8 8">
<circle class="symbol" cx="2" cy="6" r="1" />
<path class="symbol" d="m 1,4 a 3,3 0 0 1 3,3 h 1 a 4,4 0 0 0 -4,-4 z" />
<path class="symbol" d="m 1,2 a 5,5 0 0 1 5,5 h 1 a 6,6 0 0 0 -6,-6 z" />
</svg></a>
</div>
</nav>
</header>
<main class="advisory">
<article>
<span class="floating-menu">
<a href="https://github.com/RustSec/advisory-db/commits/main/crates/thin-vec/RUSTSEC-2026-0103.md">History</a> ⋅
<a href="https://github.com/RustSec/advisory-db/edit/main/crates/thin-vec/RUSTSEC-2026-0103.md">Edit</a> ⋅
<a href="https://api.osv.dev/v1/vulns/RUSTSEC-2026-0103">JSON (OSV)</a>
</span>
<header>
<h1>
RUSTSEC-2026-0103
</h1>
<span class="subtitle"><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</header>
<dl>
<dt id="reported">Reported</dt>
<dd>
<time datetime="2026-04-14">
April 14, 2026
</time>
</dd>
<dt id="issued">Issued</dt>
<dd>
<time datetime="2026-04-21">
April 21, 2026
</time>
</dd>
<dt id="package">Package</dt>
<dd>
<a href="/packages/thin-vec.html">thin-vec</a>
(<a href="https://crates.io/crates/thin-vec">crates.io</a>)
</dd>
<dt id="type">Type</dt>
<dd>
Vulnerability
</dd>
<dt id="categories">Categories</dt>
<dd>
<ul>
<li><a href="/categories/code-execution.html">code-execution</a></li>
<li><a href="/categories/memory-corruption.html">memory-corruption</a></li>
<li><a href="/categories/memory-exposure.html">memory-exposure</a></li>
</ul>
</dd>
<dt id="keywords">Keywords</dt>
<dd>
<a href="/keywords/memory-safety.html">#memory-safety</a>
<a href="/keywords/double-free.html">#double-free</a>
<a href="/keywords/use-after-free.html">#use-after-free</a>
</dd>
<dt id="aliases">Aliases</dt>
<dd>
<ul>
<li>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-6654">CVE-2026-6654</a>
</li>
<li>
<a href="https://github.com/advisories/GHSA-xphw-cqx3-667j">GHSA-xphw-cqx3-667j</a>
</li>
</ul>
</dd>
<dt id="details">References</dt>
<dd>
<ul>
<li>
<a href="https://github.com/mozilla/thin-vec/security/advisories/GHSA-xphw-cqx3-667j">
https://github.com/mozilla/thin-vec/security/advisories/GHSA-xphw-cqx3-667j
</a>
</li>
</ul>
</dd>
<dt id="cvss_score">CVSS Score</dt>
<dd>7.3 <span class="tag high">
HIGH
</span></dd>
<dt id="cvss_details">CVSS Details</dt>
<dd>
<dl>
<dt>Attack Vector</dt>
<dd>Local</dd>
<dt>Attack Complexity</dt>
<dd>Low</dd>
<dt>Privileges Required</dt>
<dd>None</dd>
<dt>User Interaction</dt>
<dd>None</dd>
<dt>Scope</dt>
<dd>Unchanged</dd>
<dt>Confidentiality Impact</dt>
<dd>Low</dd>
<dt>Integrity Impact</dt>
<dd>Low</dd>
<dt>Availability Impact</dt>
<dd>High</dd>
</dl>
</dd>
<dt id="cvss">CVSS Vector</dt>
<dd><a href="https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H">CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H</a></dd>
<dt id="patched">Patched</dt>
<dd>
<ul>
<li><code>&#62;=0.2.16</code></li>
</ul>
</dd>
</dl>
<h3 id="description">Description</h3>
<p>A Double Free / Use-After-Free (UAF) vulnerability has been identified in the
<code>IntoIter::drop</code> and <code>ThinVec::clear</code> implementations of the <code>thin_vec</code> crate.
Both vulnerabilities share the same root cause and can trigger memory
corruption using only safe Rust code - no unsafe blocks required. Undefined
Behavior has been confirmed via Miri and AddressSanitizer (ASAN).</p>
<h2>Details</h2>
<p>When a <strong>panic occurs</strong> during sequential element deallocation, the subsequent
length cleanup code (<code>set_len(0)</code>) is never executed. During stack unwinding,
the container is dropped again, causing already-freed memory to be re-freed
(Double Free / UAF).</p>
<h3>Vulnerability 1 - <code>IntoIter::drop</code></h3>
<p><code>IntoIter::drop</code> transfers ownership of the internal buffer via <code>mem::replace</code>,
then sequentially frees elements via <code>ptr::drop_in_place</code>. If a panic occurs
during element deallocation, <code>set_len_non_singleton(0)</code> is never reached.
During unwinding, <code>vec</code> is dropped again, re-freeing already-freed elements.
The standard library's <code>std::vec::IntoIter</code> prevents this with a <strong>DropGuard
pattern</strong>, but thin-vec lacks this defense.</p>
<h3>PoC</h3>
<pre><code class="language-rust">use thin_vec::ThinVec;
struct PanicBomb(String);
impl Drop for PanicBomb {
fn drop(&amp;mut self) {
if self.0 == &quot;panic&quot; {
panic!(&quot;panic!&quot;);
}
println!(&quot;Dropping: {}&quot;, self.0);
}
}
fn main() {
let mut v = ThinVec::new();
v.push(PanicBomb(String::from(&quot;normal1&quot;)));
v.push(PanicBomb(String::from(&quot;panic&quot;))); // trigger element
v.push(PanicBomb(String::from(&quot;normal2&quot;)));
let mut iter = v.into_iter();
iter.next();
// When iter is dropped: panic occurs at &quot;panic&quot; element
// → During unwinding, Double Drop is triggered on &quot;normal1&quot; (already freed)
}
</code></pre>
<h3>Vulnerability 2 - <code>ThinVec::clear</code></h3>
<p><code>clear()</code> calls <code>ptr::drop_in_place(&amp;mut self[..])</code> followed by
<code>self.set_len(0)</code> to reset the length. If a panic occurs during element
deallocation, <code>set_len(0)</code> is never executed. When the <code>ThinVec</code> itself is
subsequently dropped, already-freed elements are freed again.</p>
<h3>PoC</h3>
<pre><code class="language-rust">use thin_vec::ThinVec;
use std::panic;
struct Poison(Box&lt;usize&gt;, &amp;'static str);
impl Drop for Poison {
fn drop(&amp;mut self) {
if self.1 == &quot;panic&quot; {
panic!(&quot;panic!&quot;);
}
println!(&quot;Dropping: {}&quot;, self.0);
}
}
fn main() {
let mut v = ThinVec::new();
v.push(Poison(Box::new(1), &quot;normal1&quot;)); // index 0
v.push(Poison(Box::new(2), &quot;panic&quot;)); // index 1 → panic triggered here
v.push(Poison(Box::new(3), &quot;normal2&quot;)); // index 2
let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| {
v.clear();
// panic occurs at &quot;panic&quot; element during clear()
// → set_len(0) is never called
// → already-freed elements are re-freed when v goes out of scope
}));
}
</code></pre>
<h2>Prerequisites</h2>
<ol>
<li><code>ThinVec</code> stores heap-owning types (<code>String</code>, <code>Vec</code>, <code>Box</code>, etc.)</li>
<li>(Vulnerability 1) An iterator is created via <code>into_iter()</code> and dropped before being fully consumed, or
(Vulnerability 2) <code>clear()</code> is called while a remaining element's <code>Drop</code> implementation can panic</li>
<li>The <code>Drop</code> implementation of a remaining element triggers a panic</li>
</ol>
<p>When combined with <code>Box&lt;dyn Trait&gt; types</code>, an exploit primitive enabling
Arbitrary Code Execution (ACE) via heap spray and vtable hijacking has been
confirmed. If the freed fat pointer slot (16 bytes) at the point of Double Drop
is reclaimed by an attacker-controlled fake vtable, subsequent Drop calls can
be redirected to attacker-controlled code.</p>
<p id="license" class="license">Advisory available under <a href="https://spdx.org/licenses/CC0-1.0.html">CC0-1.0</a>
license.
</p>
</article>
</main>
+19
View File
@@ -64,6 +64,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-04-15">
April 15, 2026
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-03-10">
March 10, 2026
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-03-10">
March 10, 2026
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-03-17">
March 17, 2026
+286 -190
View File
@@ -1,5 +1,290 @@
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>RustSec Advisories</title><id>https://rustsec.org/feed.xml</id><updated>2026-04-15T12:00:00+00:00</updated><author><name>RustSec</name></author><icon>https://rustsec.org/favicon.ico</icon><link href="https://rustsec.org/feed.xml" rel="self" type="application/atom+xml"/><link href="https://rustsec.org/" rel="alternate" type="text/html"/><subtitle xml:lang="en">Security advisories filed against Rust crates</subtitle><entry><title>RUSTSEC-2026-0098: Vulnerability in rustls-webpki</title><id>https://rustsec.org/advisories/RUSTSEC-2026-0098.html</id><updated>2026-04-15T12:00:00+00:00</updated><link href="https://rustsec.org/advisories/RUSTSEC-2026-0098.html" rel="alternate" type="text/html" title="RUSTSEC-2026-0098: Vulnerability in rustls-webpki"/><published>2026-04-15T12:00:00+00:00</published><summary xml:lang="en">Name constraints for URI names were incorrectly accepted</summary><content xml:lang="en" type="html"> &lt;article&gt;
<feed xmlns="http://www.w3.org/2005/Atom"><title>RustSec Advisories</title><id>https://rustsec.org/feed.xml</id><updated>2026-04-21T12:00:00+00:00</updated><author><name>RustSec</name></author><icon>https://rustsec.org/favicon.ico</icon><link href="https://rustsec.org/feed.xml" rel="self" type="application/atom+xml"/><link href="https://rustsec.org/" rel="alternate" type="text/html"/><subtitle xml:lang="en">Security advisories filed against Rust crates</subtitle><entry><title>RUSTSEC-2026-0103: Vulnerability in thin-vec</title><id>https://rustsec.org/advisories/RUSTSEC-2026-0103.html</id><updated>2026-04-21T12:00:00+00:00</updated><category term="code-execution"/><category term="memory-corruption"/><category term="memory-exposure"/><link href="https://rustsec.org/advisories/RUSTSEC-2026-0103.html" rel="alternate" type="text/html" title="RUSTSEC-2026-0103: Vulnerability in thin-vec"/><published>2026-04-21T12:00:00+00:00</published><summary xml:lang="en">Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</summary><content xml:lang="en" type="html"> &lt;article&gt;
&lt;span class=&quot;floating-menu&quot;&gt;
&lt;a href=&quot;https://github.com/RustSec/advisory-db/commits/main/crates/thin-vec/RUSTSEC-2026-0103.md&quot;&gt;History&lt;/a&gt; ⋅
&lt;a href=&quot;https://github.com/RustSec/advisory-db/edit/main/crates/thin-vec/RUSTSEC-2026-0103.md&quot;&gt;Edit&lt;/a&gt; ⋅
&lt;a href=&quot;https://api.osv.dev/v1/vulns/RUSTSEC-2026-0103&quot;&gt;JSON (OSV)&lt;/a&gt;
&lt;/span&gt;
&lt;header&gt;
&lt;h1&gt;
RUSTSEC-2026-0103
&lt;/h1&gt;
&lt;span class=&quot;subtitle&quot;&gt;&lt;p&gt;Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics&lt;/p&gt;
&lt;/span&gt;
&lt;/header&gt;
&lt;dl&gt;
&lt;dt id=&quot;reported&quot;&gt;Reported&lt;/dt&gt;
&lt;dd&gt;
&lt;time datetime=&quot;2026-04-14&quot;&gt;
April 14, 2026
&lt;/time&gt;
&lt;/dd&gt;
&lt;dt id=&quot;issued&quot;&gt;Issued&lt;/dt&gt;
&lt;dd&gt;
&lt;time datetime=&quot;2026-04-21&quot;&gt;
April 21, 2026
&lt;/time&gt;
&lt;/dd&gt;
&lt;dt id=&quot;package&quot;&gt;Package&lt;/dt&gt;
&lt;dd&gt;
&lt;a href=&quot;/packages/thin-vec.html&quot;&gt;thin-vec&lt;/a&gt;
(&lt;a href=&quot;https://crates.io/crates/thin-vec&quot;&gt;crates.io&lt;/a&gt;)
&lt;/dd&gt;
&lt;dt id=&quot;type&quot;&gt;Type&lt;/dt&gt;
&lt;dd&gt;
Vulnerability
&lt;/dd&gt;
&lt;dt id=&quot;categories&quot;&gt;Categories&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/categories/code-execution.html&quot;&gt;code-execution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/categories/memory-corruption.html&quot;&gt;memory-corruption&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/categories/memory-exposure.html&quot;&gt;memory-exposure&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt id=&quot;keywords&quot;&gt;Keywords&lt;/dt&gt;
&lt;dd&gt;
&lt;a href=&quot;/keywords/memory-safety.html&quot;&gt;#memory-safety&lt;/a&gt;
&lt;a href=&quot;/keywords/double-free.html&quot;&gt;#double-free&lt;/a&gt;
&lt;a href=&quot;/keywords/use-after-free.html&quot;&gt;#use-after-free&lt;/a&gt;
&lt;/dd&gt;
&lt;dt id=&quot;aliases&quot;&gt;Aliases&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&quot;https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-6654&quot;&gt;CVE-2026-6654&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&quot;https://github.com/advisories/GHSA-xphw-cqx3-667j&quot;&gt;GHSA-xphw-cqx3-667j&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt id=&quot;details&quot;&gt;References&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&quot;https://github.com/mozilla/thin-vec/security/advisories/GHSA-xphw-cqx3-667j&quot;&gt;
https://github.com/mozilla/thin-vec/security/advisories/GHSA-xphw-cqx3-667j
&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt id=&quot;cvss_score&quot;&gt;CVSS Score&lt;/dt&gt;
&lt;dd&gt;7.3 &lt;span class=&quot;tag high&quot;&gt;
HIGH
&lt;/span&gt;&lt;/dd&gt;
&lt;dt id=&quot;cvss_details&quot;&gt;CVSS Details&lt;/dt&gt;
&lt;dd&gt;
&lt;dl&gt;
&lt;dt&gt;Attack Vector&lt;/dt&gt;
&lt;dd&gt;Local&lt;/dd&gt;
&lt;dt&gt;Attack Complexity&lt;/dt&gt;
&lt;dd&gt;Low&lt;/dd&gt;
&lt;dt&gt;Privileges Required&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;User Interaction&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;Scope&lt;/dt&gt;
&lt;dd&gt;Unchanged&lt;/dd&gt;
&lt;dt&gt;Confidentiality Impact&lt;/dt&gt;
&lt;dd&gt;Low&lt;/dd&gt;
&lt;dt&gt;Integrity Impact&lt;/dt&gt;
&lt;dd&gt;Low&lt;/dd&gt;
&lt;dt&gt;Availability Impact&lt;/dt&gt;
&lt;dd&gt;High&lt;/dd&gt;
&lt;/dl&gt;
&lt;/dd&gt;
&lt;dt id=&quot;cvss&quot;&gt;CVSS Vector&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H&quot;&gt;CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H&lt;/a&gt;&lt;/dd&gt;
&lt;dt id=&quot;patched&quot;&gt;Patched&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;#62;=0.2.16&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id=&quot;description&quot;&gt;Description&lt;/h3&gt;
&lt;p&gt;A Double Free / Use-After-Free (UAF) vulnerability has been identified in the
&lt;code&gt;IntoIter::drop&lt;/code&gt; and &lt;code&gt;ThinVec::clear&lt;/code&gt; implementations of the &lt;code&gt;thin_vec&lt;/code&gt; crate.
Both vulnerabilities share the same root cause and can trigger memory
corruption using only safe Rust code - no unsafe blocks required. Undefined
Behavior has been confirmed via Miri and AddressSanitizer (ASAN).&lt;/p&gt;
&lt;h2&gt;Details&lt;/h2&gt;
&lt;p&gt;When a &lt;strong&gt;panic occurs&lt;/strong&gt; during sequential element deallocation, the subsequent
length cleanup code (&lt;code&gt;set_len(0)&lt;/code&gt;) is never executed. During stack unwinding,
the container is dropped again, causing already-freed memory to be re-freed
(Double Free / UAF).&lt;/p&gt;
&lt;h3&gt;Vulnerability 1 - &lt;code&gt;IntoIter::drop&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;IntoIter::drop&lt;/code&gt; transfers ownership of the internal buffer via &lt;code&gt;mem::replace&lt;/code&gt;,
then sequentially frees elements via &lt;code&gt;ptr::drop_in_place&lt;/code&gt;. If a panic occurs
during element deallocation, &lt;code&gt;set_len_non_singleton(0)&lt;/code&gt; is never reached.
During unwinding, &lt;code&gt;vec&lt;/code&gt; is dropped again, re-freeing already-freed elements.
The standard library&apos;s &lt;code&gt;std::vec::IntoIter&lt;/code&gt; prevents this with a &lt;strong&gt;DropGuard
pattern&lt;/strong&gt;, but thin-vec lacks this defense.&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;use thin_vec::ThinVec;
struct PanicBomb(String);
impl Drop for PanicBomb {
fn drop(&amp;amp;mut self) {
if self.0 == &amp;quot;panic&amp;quot; {
panic!(&amp;quot;panic!&amp;quot;);
}
println!(&amp;quot;Dropping: {}&amp;quot;, self.0);
}
}
fn main() {
let mut v = ThinVec::new();
v.push(PanicBomb(String::from(&amp;quot;normal1&amp;quot;)));
v.push(PanicBomb(String::from(&amp;quot;panic&amp;quot;))); // trigger element
v.push(PanicBomb(String::from(&amp;quot;normal2&amp;quot;)));
let mut iter = v.into_iter();
iter.next();
// When iter is dropped: panic occurs at &amp;quot;panic&amp;quot; element
// → During unwinding, Double Drop is triggered on &amp;quot;normal1&amp;quot; (already freed)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Vulnerability 2 - &lt;code&gt;ThinVec::clear&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;clear()&lt;/code&gt; calls &lt;code&gt;ptr::drop_in_place(&amp;amp;mut self[..])&lt;/code&gt; followed by
&lt;code&gt;self.set_len(0)&lt;/code&gt; to reset the length. If a panic occurs during element
deallocation, &lt;code&gt;set_len(0)&lt;/code&gt; is never executed. When the &lt;code&gt;ThinVec&lt;/code&gt; itself is
subsequently dropped, already-freed elements are freed again.&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;use thin_vec::ThinVec;
use std::panic;
struct Poison(Box&amp;lt;usize&amp;gt;, &amp;amp;&apos;static str);
impl Drop for Poison {
fn drop(&amp;amp;mut self) {
if self.1 == &amp;quot;panic&amp;quot; {
panic!(&amp;quot;panic!&amp;quot;);
}
println!(&amp;quot;Dropping: {}&amp;quot;, self.0);
}
}
fn main() {
let mut v = ThinVec::new();
v.push(Poison(Box::new(1), &amp;quot;normal1&amp;quot;)); // index 0
v.push(Poison(Box::new(2), &amp;quot;panic&amp;quot;)); // index 1 → panic triggered here
v.push(Poison(Box::new(3), &amp;quot;normal2&amp;quot;)); // index 2
let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| {
v.clear();
// panic occurs at &amp;quot;panic&amp;quot; element during clear()
// → set_len(0) is never called
// → already-freed elements are re-freed when v goes out of scope
}));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;ThinVec&lt;/code&gt; stores heap-owning types (&lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Vec&lt;/code&gt;, &lt;code&gt;Box&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;(Vulnerability 1) An iterator is created via &lt;code&gt;into_iter()&lt;/code&gt; and dropped before being fully consumed, or
(Vulnerability 2) &lt;code&gt;clear()&lt;/code&gt; is called while a remaining element&apos;s &lt;code&gt;Drop&lt;/code&gt; implementation can panic&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Drop&lt;/code&gt; implementation of a remaining element triggers a panic&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When combined with &lt;code&gt;Box&amp;lt;dyn Trait&amp;gt; types&lt;/code&gt;, an exploit primitive enabling
Arbitrary Code Execution (ACE) via heap spray and vtable hijacking has been
confirmed. If the freed fat pointer slot (16 bytes) at the point of Double Drop
is reclaimed by an attacker-controlled fake vtable, subsequent Drop calls can
be redirected to attacker-controlled code.&lt;/p&gt;
&lt;p id=&quot;license&quot; class=&quot;license&quot;&gt;Advisory available under &lt;a href=&quot;https://spdx.org/licenses/CC0-1.0.html&quot;&gt;CC0-1.0&lt;/a&gt;
license.
&lt;/p&gt;
&lt;/article&gt;</content></entry><entry><title>RUSTSEC-2026-0098: Vulnerability in rustls-webpki</title><id>https://rustsec.org/advisories/RUSTSEC-2026-0098.html</id><updated>2026-04-15T12:00:00+00:00</updated><link href="https://rustsec.org/advisories/RUSTSEC-2026-0098.html" rel="alternate" type="text/html" title="RUSTSEC-2026-0098: Vulnerability in rustls-webpki"/><published>2026-04-15T12:00:00+00:00</published><summary xml:lang="en">Name constraints for URI names were incorrectly accepted</summary><content xml:lang="en" type="html"> &lt;article&gt;
&lt;span class=&quot;floating-menu&quot;&gt;
&lt;a href=&quot;https://github.com/RustSec/advisory-db/commits/main/crates/rustls-webpki/RUSTSEC-2026-0098.md&quot;&gt;History&lt;/a&gt; ⋅
@@ -1228,194 +1513,5 @@ For more information see the GitHub-hosted security advisory.&lt;/p&gt;
license.
&lt;/p&gt;
&lt;/article&gt;</content></entry><entry><title>RUSTSEC-2026-0089: Vulnerability in wasmtime</title><id>https://rustsec.org/advisories/RUSTSEC-2026-0089.html</id><updated>2026-04-09T12:00:00+00:00</updated><link href="https://rustsec.org/advisories/RUSTSEC-2026-0089.html" rel="alternate" type="text/html" title="RUSTSEC-2026-0089: Vulnerability in wasmtime"/><published>2026-04-09T12:00:00+00:00</published><summary xml:lang="en">Host panic when Winch compiler executes `table.fill`</summary><content xml:lang="en" type="html"> &lt;article&gt;
&lt;span class=&quot;floating-menu&quot;&gt;
&lt;a href=&quot;https://github.com/RustSec/advisory-db/commits/main/crates/wasmtime/RUSTSEC-2026-0089.md&quot;&gt;History&lt;/a&gt; ⋅
&lt;a href=&quot;https://github.com/RustSec/advisory-db/edit/main/crates/wasmtime/RUSTSEC-2026-0089.md&quot;&gt;Edit&lt;/a&gt; ⋅
&lt;a href=&quot;https://api.osv.dev/v1/vulns/RUSTSEC-2026-0089&quot;&gt;JSON (OSV)&lt;/a&gt;
&lt;/span&gt;
&lt;header&gt;
&lt;h1&gt;
RUSTSEC-2026-0089
&lt;/h1&gt;
&lt;span class=&quot;subtitle&quot;&gt;&lt;p&gt;Host panic when Winch compiler executes &lt;code&gt;table.fill&lt;/code&gt;&lt;/p&gt;
&lt;/span&gt;
&lt;/header&gt;
&lt;dl&gt;
&lt;dt id=&quot;reported&quot;&gt;Reported&lt;/dt&gt;
&lt;dd&gt;
&lt;time datetime=&quot;2026-04-09&quot;&gt;
April 9, 2026
&lt;/time&gt;
&lt;/dd&gt;
&lt;dt id=&quot;issued&quot;&gt;Issued&lt;/dt&gt;
&lt;dd&gt;
&lt;time datetime=&quot;2026-04-09&quot;&gt;
April 9, 2026
&lt;/time&gt;
&lt;/dd&gt;
&lt;dt id=&quot;package&quot;&gt;Package&lt;/dt&gt;
&lt;dd&gt;
&lt;a href=&quot;/packages/wasmtime.html&quot;&gt;wasmtime&lt;/a&gt;
(&lt;a href=&quot;https://crates.io/crates/wasmtime&quot;&gt;crates.io&lt;/a&gt;)
&lt;/dd&gt;
&lt;dt id=&quot;type&quot;&gt;Type&lt;/dt&gt;
&lt;dd&gt;
Vulnerability
&lt;/dd&gt;
&lt;dt id=&quot;aliases&quot;&gt;Aliases&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&quot;https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-34946&quot;&gt;CVE-2026-34946&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&quot;https://github.com/advisories/GHSA-q49f-xg75-m9xw&quot;&gt;GHSA-q49f-xg75-m9xw&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt id=&quot;details&quot;&gt;References&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&quot;https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q49f-xg75-m9xw&quot;&gt;
https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q49f-xg75-m9xw
&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt id=&quot;cvss_score&quot;&gt;CVSS Score&lt;/dt&gt;
&lt;dd&gt;5.9 &lt;span class=&quot;tag medium&quot;&gt;
MEDIUM
&lt;/span&gt;&lt;/dd&gt;
&lt;dt id=&quot;cvss_details&quot;&gt;CVSS Details&lt;/dt&gt;
&lt;dd&gt;
&lt;dl&gt;
&lt;dt&gt;Attack Complexity&lt;/dt&gt;
&lt;dd&gt;Low&lt;/dd&gt;
&lt;dt&gt;Attack Requirements&lt;/dt&gt;
&lt;dd&gt;Present&lt;/dd&gt;
&lt;dt&gt;Attack Vector&lt;/dt&gt;
&lt;dd&gt;Network&lt;/dd&gt;
&lt;dt&gt;Privileges Required&lt;/dt&gt;
&lt;dd&gt;Low&lt;/dd&gt;
&lt;dt&gt;Availability Impact to the Subsequent System&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;Confidentiality Impact to the Subsequent System&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;Integrity Impact to the Subsequent System&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;User Interaction&lt;/dt&gt;
&lt;dd&gt;Passive&lt;/dd&gt;
&lt;dt&gt;Availability Impact to the Vulnerable System&lt;/dt&gt;
&lt;dd&gt;High&lt;/dd&gt;
&lt;dt&gt;Confidentiality Impact to the Vulnerable System&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;dt&gt;Integrity Impact to the Vulnerable System&lt;/dt&gt;
&lt;dd&gt;None&lt;/dd&gt;
&lt;/dl&gt;
&lt;/dd&gt;
&lt;dt id=&quot;cvss&quot;&gt;CVSS Vector&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;https://www.first.org/cvss/calculator/3.1#CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N&quot;&gt;CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N&lt;/a&gt;&lt;/dd&gt;
&lt;dt id=&quot;patched&quot;&gt;Patched&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;#62;=36.0.7, &amp;#60;37.0.0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#62;=42.0.2, &amp;#60;43.0.0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#62;=43.0.1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id=&quot;description&quot;&gt;Description&lt;/h3&gt;
&lt;p&gt;This is an entry in the RustSec database for the Wasmtime security advisory
located at
https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q49f-xg75-m9xw
For more information see the GitHub-hosted security advisory.&lt;/p&gt;
&lt;p id=&quot;license&quot; class=&quot;license&quot;&gt;Advisory available under &lt;a href=&quot;https://spdx.org/licenses/CC0-1.0.html&quot;&gt;CC0-1.0&lt;/a&gt;
license.
&lt;/p&gt;
&lt;/article&gt;</content></entry></feed>
+2 -2
View File
File diff suppressed because one or more lines are too long
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-02-27">
February 27, 2026
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-02-24">
February 24, 2026
+19
View File
@@ -66,6 +66,25 @@
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
<li>
<time datetime="2026-02-27">
February 27, 2026
+6
View File
@@ -4026,6 +4026,12 @@
</li>
<li><a href="/packages/thin-vec.html">thin-vec</a>
(1)
</li>
<li><a href="/packages/thread-amount.html">thread-amount</a>
(1)
+90
View File
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="author" content="Rust Project Developers">
<meta name="description" content="Security advisory database for Rust crates published through https://crates.io">
<title>Advisories for package &#39;thin-vec&#39; › RustSec Advisory Database</title>
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,300italic,400italic" rel="stylesheet">
<link href="/css/basic.css" rel="stylesheet">
<link href="/css/highlight.css" rel="stylesheet">
<link href="/css/index.css" rel="stylesheet">
<script src="/js/index.js" defer></script>
<script src="/js/search.js" defer></script>
<header>
<div class="header-top">
<h1><a href="/">
<picture>
<source srcset="/img/rustsec-logo-light.svg" media="(prefers-color-scheme: light)">
<img src="/img/rustsec-logo-dark.svg" alt="RustSec logo" class="logo-image">
</picture>
</a></h1>
<div class="search">
<form onsubmit="return searchform();">
<input type="search" id="search-term"
placeholder="Look up package or ID..." required
size="20">
</form>
</div>
</div>
<nav>
<div>
<a href="/">About</a>
<a href="/advisories/">Advisories</a>
<a href="/contributing.html">Report Vulnerabilities</a>
</div>
<div>
<a href="https://rust-lang.zulipchat.com/login/#narrow/stream/146229-wg-secure-code/" title="Zulip" aria-label="Zulip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height:1em;fill:currentColor"><path d="M473.09 122.97c0 22.69-10.19 42.85-25.72 55.08L296.61 312.69c-2.8 2.4-6.44-1.47-4.42-4.7l55.3-110.72c1.55-3.1-.46-6.91-3.64-6.91H129.36c-33.22 0-60.4-30.32-60.4-67.37 0-37.06 27.18-67.37 60.4-67.37h283.33c33.22-.02 60.4 30.3 60.4 67.35zM129.36 506.05h283.33c33.22 0 60.4-30.32 60.4-67.37 0-37.06-27.18-67.37-60.4-67.37H198.2c-3.18 0-5.19-3.81-3.64-6.91l55.3-110.72c2.02-3.23-1.62-7.1-4.42-4.7L94.68 383.6c-15.53 12.22-25.72 32.39-25.72 55.08 0 37.05 27.18 67.37 60.4 67.37zm522.5-124.15l124.78-179.6v-1.56H663.52v-48.98h190.09v34.21L731.55 363.24v1.56h124.01v48.98h-203.7V381.9zm338.98-230.14V302.6c0 45.09 17.1 68.03 47.43 68.03 31.1 0 48.2-21.77 48.2-68.03V151.76h59.09V298.7c0 80.86-40.82 119.34-109.24 119.34-66.09 0-104.96-36.54-104.96-120.12V151.76h59.48zm244.91 0h59.48v212.25h104.18v49.76h-163.66V151.76zm297 0v262.01h-59.48V151.76h59.48zm90.18 3.5c18.27-3.11 43.93-5.44 80.08-5.44 36.54 0 62.59 7 80.08 20.99 16.72 13.22 27.99 34.99 27.99 60.64 0 25.66-8.55 47.43-24.1 62.2-20.21 19.05-50.15 27.6-85.13 27.6-7.77 0-14.77-.39-20.21-1.17v93.69h-58.7V155.26zm58.7 118.96c5.05 1.17 11.27 1.55 19.83 1.55 31.49 0 50.92-15.94 50.92-42.76 0-24.1-16.72-38.49-46.26-38.49-12.05 0-20.21 1.17-24.49 2.33v77.37z"/></svg></a>
<a href="https://twitter.com/RustSec/" title="Twitter" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height:1em;fill:currentColor"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
<a href="https://github.com/RustSec/" title="GitHub" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" style="height:1em;fill:currentColor"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg></a>
<a href="/feed.xml" title="Atom Feed" aria-label="Atom Feed"><svg xmlns="http://www.w3.org/2000/svg" style="height:1em" viewBox="0 0 8 8">
<circle class="symbol" cx="2" cy="6" r="1" />
<path class="symbol" d="m 1,4 a 3,3 0 0 1 3,3 h 1 a 4,4 0 0 0 -4,-4 z" />
<path class="symbol" d="m 1,2 a 5,5 0 0 1 5,5 h 1 a 6,6 0 0 0 -6,-6 z" />
</svg></a>
</div>
</nav>
</header>
<main class="advisories">
<article>
<header>
<span class="floating-menu">
<a href="/categories/">Categories</a> ⋅
<a href="/keywords/">Keywords</a> ⋅
<a href="/packages/">Packages</a>
</span>
<h1>Advisories for package &#39;thin-vec&#39;</h1>
</header>
<ul>
<li>
<time datetime="2026-04-21">
April 21, 2026
</time>
<h3>
<span class="tag high">HIGH</span>
<a href="/advisories/RUSTSEC-2026-0103.html">
RUSTSEC-2026-0103: Vulnerability in thin-vec
</a>
</h3>
<span><p>Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics</p>
</span>
</li>
</ul>
</article>
</main>
+77
View File
@@ -0,0 +1,77 @@
[
{
"id": "RUSTSEC-2026-0103",
"modified": "2026-04-21T07:33:14Z",
"published": "2026-04-14T12:00:00Z",
"aliases": [
"CVE-2026-6654",
"GHSA-xphw-cqx3-667j"
],
"related": [],
"summary": "Use-After-Free and Double Free in IntoIter::drop When Element Drop Panics",
"details": "A Double Free / Use-After-Free (UAF) vulnerability has been identified in the\n`IntoIter::drop` and `ThinVec::clear` implementations of the `thin_vec` crate.\nBoth vulnerabilities share the same root cause and can trigger memory\ncorruption using only safe Rust code - no unsafe blocks required. Undefined\nBehavior has been confirmed via Miri and AddressSanitizer (ASAN).\n\n## Details\n\nWhen a **panic occurs** during sequential element deallocation, the subsequent\nlength cleanup code (`set_len(0)`) is never executed. During stack unwinding,\nthe container is dropped again, causing already-freed memory to be re-freed\n(Double Free / UAF).\n\n### Vulnerability 1 - `IntoIter::drop`\n\n`IntoIter::drop` transfers ownership of the internal buffer via `mem::replace`,\nthen sequentially frees elements via `ptr::drop_in_place`. If a panic occurs\nduring element deallocation, `set_len_non_singleton(0)` is never reached.\nDuring unwinding, `vec` is dropped again, re-freeing already-freed elements.\nThe standard library's `std::vec::IntoIter` prevents this with a **DropGuard\npattern**, but thin-vec lacks this defense.\n\n### PoC\n\n```rust\nuse thin_vec::ThinVec;\n\nstruct PanicBomb(String);\n\nimpl Drop for PanicBomb {\n fn drop(&mut self) {\n if self.0 == \"panic\" {\n panic!(\"panic!\");\n }\n println!(\"Dropping: {}\", self.0);\n }\n}\n\nfn main() {\n let mut v = ThinVec::new();\n v.push(PanicBomb(String::from(\"normal1\")));\n v.push(PanicBomb(String::from(\"panic\"))); // trigger element\n v.push(PanicBomb(String::from(\"normal2\")));\n\n let mut iter = v.into_iter();\n iter.next();\n // When iter is dropped: panic occurs at \"panic\" element\n // → During unwinding, Double Drop is triggered on \"normal1\" (already freed)\n}\n```\n\n### Vulnerability 2 - `ThinVec::clear`\n\n`clear()` calls `ptr::drop_in_place(&mut self[..])` followed by\n`self.set_len(0)` to reset the length. If a panic occurs during element\ndeallocation, `set_len(0)` is never executed. When the `ThinVec` itself is\nsubsequently dropped, already-freed elements are freed again.\n\n### PoC\n\n```rust\nuse thin_vec::ThinVec;\nuse std::panic;\n\nstruct Poison(Box<usize>, &'static str);\n\nimpl Drop for Poison {\n fn drop(&mut self) {\n if self.1 == \"panic\" {\n panic!(\"panic!\");\n }\n println!(\"Dropping: {}\", self.0);\n }\n}\n\nfn main() {\n let mut v = ThinVec::new();\n v.push(Poison(Box::new(1), \"normal1\")); // index 0\n v.push(Poison(Box::new(2), \"panic\")); // index 1 → panic triggered here\n v.push(Poison(Box::new(3), \"normal2\")); // index 2\n\n let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| {\n v.clear();\n // panic occurs at \"panic\" element during clear()\n // → set_len(0) is never called\n // → already-freed elements are re-freed when v goes out of scope\n }));\n}\n```\n\n## Prerequisites\n\n1. `ThinVec` stores heap-owning types (`String`, `Vec`, `Box`, etc.)\n2. (Vulnerability 1) An iterator is created via `into_iter()` and dropped before being fully consumed, or\n (Vulnerability 2) `clear()` is called while a remaining element's `Drop` implementation can panic\n3. The `Drop` implementation of a remaining element triggers a panic\n\nWhen combined with `Box<dyn Trait> types`, an exploit primitive enabling\nArbitrary Code Execution (ACE) via heap spray and vtable hijacking has been\nconfirmed. If the freed fat pointer slot (16 bytes) at the point of Double Drop\nis reclaimed by an attacker-controlled fake vtable, subsequent Drop calls can\nbe redirected to attacker-controlled code.",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
}
],
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "thin-vec",
"purl": "pkg:cargo/thin-vec"
},
"ecosystem_specific": {
"affects": {
"arch": [],
"os": [],
"functions": []
},
"affected_functions": null
},
"database_specific": {
"categories": [
"code-execution",
"memory-corruption",
"memory-exposure"
],
"cvss": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H",
"informational": null
},
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.2.16"
}
]
}
],
"versions": []
}
],
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/thin-vec"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0103.html"
},
{
"type": "ADVISORY",
"url": "https://github.com/mozilla/thin-vec/security/advisories/GHSA-xphw-cqx3-667j"
}
],
"database_specific": {
"license": "CC0-1.0"
}
}
]