Intel

AIKIDO-2026-43143

smallvec is vulnerable to Use After Free

Use After Free Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Today

59

Medium Risk

This Affects:

RUSTsmallvec
1.11.0 - 1.15.1
Fixed in 1.15.2
Are you affected? Scan for Free

TL;DR

When the optional drain_keep_rest feature is enabled, calling DrainFilter::keep_rest on a SmallVec with zero inline capacity can skip necessary tail element relocation. The affected logic compares array type size instead of element type size, so non-zero-sized elements are treated like zero-sized types and tail data is left in freed storage. Subsequent reads or drops through the SmallVec can trigger use-after-free or double-drop undefined behavior. The patch compares element type size correctly so tail elements are backshifted before the vector length is updated.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you enable the drain_keep_rest Cargo feature with a SmallVec that has zero inline capacity.

Background info

smallvec is vulnerable to Use After Free in versions 1.11.0 - 1.15.1.

How to fix this

Upgrade the smallvec library to the patch version.