Miggo Logo

CVE-2022-36114: Cargo extracting malicious crates can fill the file system

4.2

CVSS Score
3.1

Basic Information

EPSS Score
0.45139%
Published
9/16/2022
Updated
8/14/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
cargorust< 0.65.00.65.0
cargorust= 0.66.00.67.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from Cargo's tarball extraction logic not enforcing size limits. The critical code change in the patch adds a LimitErrorReader wrapper around the GzDecoder in src/cargo/sources/registry/mod.rs, indicating the vulnerable code path was the tarball extraction without this limit. The pre-patch code directly used GzDecoder without size constraints, making the extraction function vulnerable to disk exhaustion attacks. The affected code is clearly in the registry source handling where crate unpacking occurs.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** Rust S**urity R*spons* W* w*s noti*i** t**t **r*o *i* not pr*v*nt *xtr**tin* som* m*l*orm** p**k***s *ownlo**** *rom *lt*rn*t* r**istri*s. *n *tt**k*r **l* to uplo** p**k***s to *n *lt*rn*t* r**istry *oul* *ill t** *il* syst*m w**n **r*o *ownlo**

Reasoning

T** vuln*r**ility st*ms *rom **r*o's t*r**ll *xtr**tion lo*i* not *n*or*in* siz* limits. T** *riti**l *o** ***n** in t** p*t** ***s * Limit*rrorR****r wr*pp*r *roun* t** *z***o**r in sr*/**r*o/sour**s/r**istry/mo*.rs, in*i**tin* t** vuln*r**l* *o** p