CVE-2019-16882:
Use after free in string-interner
7.5
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
string-interner | rust | >= 0.7.0, < 0.7.1 | 0.7.1 |
string-interner | rust | < 0.6.4 | 0.6.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using #[derive(Clone)] which created a shallow copy of the internal HashMap containing raw pointers (InternalStrRef). These pointers referenced the original interner's Box<str> allocations. When the original interner was dropped, cloned interners' pointers became invalid. The fix involved manually implementing Clone to rebuild the HashMap with fresh pointers pointing to newly cloned string allocations, proving the derived implementation was unsafe. The commit explicitly removes the derive macro and adds a safe manual implementation, confirming the root cause.