Miggo Logo

CVE-2019-16882:
Use after free in string-interner

7.5

CVSS Score

Basic Information

EPSS Score
-
Published
8/25/2021
Updated
6/13/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
string-internerrust>= 0.7.0, < 0.7.10.7.1
string-internerrust< 0.6.40.6.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*****t** v*rsions o* t*is *r*t* *i* not *lon* *ont*in** strin*s w**n *n int*rn*r is *lon**. Int*rn*rs **v* r*w point*rs to t** *ont*in** strin*s, *n* t**y k**p pointin* t** strin*s w*i** t** ol* int*rn*r owns, **t*r t** int*rn*r is *lon**. I* * n*w *

Reasoning

T** vuln*r**ility st*mm** *rom usin* #[**riv*(*lon*)] w*i** *r**t** * s**llow *opy o* t** int*rn*l **s*M*p *ont*inin* r*w point*rs (Int*rn*lStrR**). T**s* point*rs r***r*n*** t** ori*in*l int*rn*r's *ox<str> *llo**tions. W**n t** ori*in*l int*rn*r w*