smallvec is vulnerable to Use After Free
59
Medium Risk
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.
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.
smallvec is vulnerable to Use After Free in versions 1.11.0 - 1.15.1.
Upgrade the smallvec library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant