Miggo Logo

CVE-2023-30620: mindsdb arbitrary file write when extracting a remotely retrieved Tarball

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.80271%
Published
3/30/2023
Updated
9/25/2024
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:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
mindsdbpip< 23.2.1.023.2.1.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the tarfile.extractall() call in the File resource's PUT handler when processing .tar.gz files. This function is vulnerable because:

  1. It processes remotely retrieved archives (via URL)
  2. Uses the unsafe tarfile.extractall() without path validation
  3. The Python documentation explicitly warns about this pattern being vulnerable to path traversal
  4. The patch replaces this exact call with a safe_extract wrapper
  5. The attack scenario demonstrates how this leads to arbitrary file writes
  6. The CWE-22 mapping confirms this is a path traversal vulnerability

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry *n uns*** *xtr**tion is **in* p*r*orm** usin* `t*r*il*.*xtr**t*ll()` *rom * r*mot*ly r*tri*v** t*r**ll. W*i** m*y l*** to t** writin* o* t** *xtr**t** *il*s to *n unint*n*** lo**tion. Som*tim*s, t** vuln*r**ility is **ll** * T*rSlip or *

Reasoning

T** vuln*r**ility st*ms *rom t** `t*r*il*.*xtr**t*ll()` **ll in t** *il* r*sour**'s PUT **n*l*r w**n pro**ssin* .t*r.*z *il*s. T*is *un*tion is vuln*r**l* ****us*: *. It pro**ss*s r*mot*ly r*tri*v** *r**iv*s (vi* URL) *. Us*s t** uns*** `t*r*il*.*xtr