Miggo Logo

CVE-2021-43790:
Use After Free in lucet

8.6

CVSS Score
3.1

Basic Information

EPSS Score
0.65035%
Published
11/30/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
lucet-runtimerust<= 0.6.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the destructor sequence in InstanceHandle. The original code destructed the 'alloc' field first, releasing memory while other fields' destructors were still pending. The fix explicitly uses ManuallyDrop to ensure 'alloc' is only dropped after the entire Instance is destroyed. The key vulnerable code path is clearly in the Drop implementation of InstanceHandle, as shown in the commit diff modifying this specific destructor logic.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T**r* is * *u* in t** m*in *r*n** o* Lu**t's `lu**t-runtim*` t**t *llows * us*-**t*r-*r** in *n `Inst*n**` o*j**t t**t *oul* r*sult in m*mory *orruption, **t* r***, or ot**r r*l*t** issu*s. T*is *u* w*s intro*u*** **rly in t** **v*lopm*nt

Reasoning

T** vuln*r**ility st*ms *rom t** **stru*tor s*qu*n** in `Inst*n****n*l*`. T** ori*in*l *o** **stru*t** t** '*llo*' *i*l* *irst, r*l**sin* m*mory w*il* ot**r *i*l*s' **stru*tors w*r* still p*n*in*. T** *ix *xpli*itly us*s `M*nu*lly*rop` to *nsur* '*ll