CVE-2021-31162

In the standard library in Rust before 1.52.0, a double free can occur in the Vec::from_iter function if freeing the element panics

published April 14, 2021

CVSS
—
EPSS
3%
Percentile
86.8
In the wild
Unconfirmed
What it is

⚠️ A double free in Rust's Vec::from_iter could seriously trip up your applications! Imagine a waiter trying to serve two meals at once, only to accidentally drop one. 🍽️ Think of this vulnerability as a busy restaurant where a waiter mistakenly tries to serve the same dish twice. Instead of properly handling the order, the kitchen ends up confused, leading to a chaotic scene. If a panic occurs while freeing an element, it could lead to undefined behavior in your application. This might not be common, but if it happens, it could cause unexpected crashes or data corruption, leaving users with a not-so-delicious experience!

Put simply

Think of this vulnerability as a busy restaurant where a waiter mistakenly tries to serve the same dish twice. Instead of properly handling the order, the kitchen ends up confused, leading to a chaotic scene. This double free vulnerability arises in Rust's standard library in versions before 1.52.0, specifically in the Vec::from_iter function. If an element being freed triggers a panic, it can lead to multiple attempts to free the same memory, causing instability.

What to do

If a panic occurs while freeing an element, it could lead to undefined behavior in your application. This might not be common, but if it happens, it could cause unexpected crashes or data corruption, leaving users with a not-so-delicious experience! Update your Rust installation to version 1.52.0 or later to ensure you're protected against this issue. Regularly review your dependencies to catch similar vulnerabilities early. You've got this! By updating your software, you’ll be on your way to keeping your applications safe and sound. 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.02890 · 86.8th percentile
Published
2021-04-14T00:00Z
EPSS history
Timeline
  • 14 APR 00:00Z
    In the standard library in Rust before 1.52.0, a double free can occur in the Vec::from_iter function if freeing the element panics
    cvelistv5