Miggo Logo

CVE-2023-48299: TorchServe ZipSlip

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.68158%
Published
11/21/2023
Updated
11/21/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
torchservepip>= 0.1.0, < 0.9.00.9.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from missing path validation in archive extraction functions. The commit diff shows both unzip() and decompressTarGzipFile() were patched with canonical path checks to prevent ZipSlip. The pre-patch code: 1) Used zip/tar entry names directly to create File objects 2) Lacked the canonical path comparison that ensures extracted files remain within the target directory 3) Matches the CWE-22 pattern of improper path limitation. The functions' direct handling of archive entries without validation makes them clearly vulnerable.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t Usin* t** mo**l/work*low m*n***m*nt *PI, t**r* is * ***n** o* uplo**in* pot*nti*lly **rm*ul *r**iv*s t**t *ont*in *il*s t**t *r* *xtr**t** to *ny lo**tion on t** *il*syst*m t**t is wit*in t** pro**ss p*rmissions. L*v*r**in* t*is issu* *oul

Reasoning

T** vuln*r**ility st*ms *rom missin* p*t* v*li**tion in *r**iv* *xtr**tion *un*tions. T** *ommit *i** s*ows *ot* `unzip()` *n* `***ompr*ssT*r*zip*il*()` w*r* p*t**** wit* **noni**l p*t* ****ks to pr*v*nt ZipSlip. T** pr*-p*t** *o**: *) Us** zip/t*r *