Miggo Logo

CVE-2023-49297: PyDrive2's unsafe YAML deserialization in LoadSettingsFile allows arbitrary code execution

3.3

CVSS Score
3.1

Basic Information

EPSS Score
0.29847%
Published
12/5/2023
Updated
11/22/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
PyDrive2pip= 1.17.0
PyDrive2pip< 1.16.21.16.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from LoadSettingsFile using yaml.load() with the unsafe CLoader (instead of SafeLoader). This allows deserialization of malicious YAML payloads containing Python object constructs. The function automatically loads settings.yaml from the working directory when initializing GoogleAuth, making it vulnerable to attack simply by file presence. The commit diff confirms the fix by switching to CSafeLoader, directly addressing the unsafe deserialization.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry Uns*** Y*ML **s*riliz*tion will r*sult in *r*itr*ry *o** *x**ution. * m*li*iously *r**t** Y*ML *il* **n **us* *r*itr*ry *o** *x**ution i* Py*riv** is run in t** s*m* *ir**tory *s it, or i* it is lo**** in vi* `Lo**S*ttin*s*il*`. ### **t*

Reasoning

T** vuln*r**ility st*ms *rom `Lo**S*ttin*s*il*` usin* `y*ml.lo**()` wit* t** uns*** `*Lo***r` (inst*** o* `S***Lo***r`). T*is *llows **s*ri*liz*tion o* m*li*ious Y*ML p*ylo**s *ont*inin* Pyt*on o*j**t *onstru*ts. T** *un*tion *utom*ti**lly lo**s `s*t