CVE-2020-35889: Memory safety violation in crayon
8.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.55836%
CWE
Published
8/25/2021
Updated
1/9/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
crayon | rust | <= 0.7.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from ObjectPool methods assuming HandleLike trait methods (index()/version()) are pure/constant. The get and get_mut methods first check handle validity via contains(), then immediately use handle.index() in unsafe array accesses. A malicious HandleLike implementation could return different values between these operations, leading to out-of-bounds memory access. The Drop implementation also uses handle.index() without validation, but the primary attack surface is in the get/get_mut methods that combine safety checks with subsequent unsafe accesses based on potentially changing handle values.