CVE-2020-35916: Mutable reference with immutable provenance in image
5.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.1703%
CWE
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
image | rust | < 0.23.12 | 0.23.12 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from macro-generated Pixel trait implementations using slice::as_ptr() instead of slice::as_mut_ptr() in their from_slice_mut functions. The commit diff shows the fix was applied to a macro template in src/color.rs that generates these pixel type implementations. The RustSec advisory explicitly lists these functions as vulnerable, and the CVE description confirms the pattern of creating mutable references from pointers with immutable provenance. High confidence comes from: 1) Direct match between patched code and vulnerable functions 2) Explicit listing in advisory 3) Clear explanation in commit message about pointer provenance violation.