CVE-2021-25908: Double free in fil-ocl
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.55713%
CWE
Published
8/25/2021
Updated
1/9/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
fil-ocl | rust | >= 0.12.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability occurs in the From<[E; $len]> implementation shown in event.rs
lines 1037-1050. The code uses ptr::read
to transfer ownership of array elements to the EventList
, then calls mem::forget
on the original array. However, if a panic occurs in the user-provided Into<Event>
conversion during the loop, the mem::forget
never executes, causing the original array to be dropped normally. This results in double-free of elements that were already moved via ptr::read
and potentially dropped during stack unwinding. The GitHub issue (#194) specifically demonstrates this scenario and confirms the lack of panic safety mechanisms like ManuallyDrop
.