CVE-2023-49297 Unsafe YAML deserialization in PyDrive2
A malicious YAML file in the working directory allows arbitrary code execution when initializing GoogleAuth in PyDrive2.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2023-49297?
CVE-2023-49297 is a low-severity unsafe deserialization vulnerability in iterative PyDrive2, published on 5 Dec 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
PyDrive2 is a wrapper library of google-api-python-client that simplifies many common Google Drive API V2 tasks. Unsafe YAML deserilization will result in arbitrary code execution. A maliciously crafted YAML file can cause arbitrary code execution if PyDrive2 is run in the same directory as it, or if it is loaded in via `LoadSettingsFile`. This is a deserilization attack that will affect any user who initializes GoogleAuth from this package while a malicious yaml file is present in the same directory. This vulnerability does not require the file to be directly loaded through the code, only present. This issue has been addressed in commit `c57355dc` which is included in release version `1.16.2`. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-502
Which versions are affected by CVE-2023-49297?
5 open source packages ship an affected version, including pydrive2 and PyDrive2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pydrive2 PyPI | All versions | None |
pydrive2 PyPI | All versions | 1.16.2 |
pydrive2 PyPI | All versions | 1.16.2 |
PyDrive2 PyPI | All versions | None |
PyDrive2 PyPI | All versions | 1.16.2 |
Linux distribution packages (1)
python-pydrive2 openSUSE:Tumbleweed | All versions | 1.18.1-2.4 |
Products include Iterative Pydrive2.
How do I fix CVE-2023-49297?
Upgrade pydrive2 to 1.16.2 or later.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2023-49297 being exploited?
There is no known exploitation of CVE-2023-49297 in the wild and no public exploit code.
Sources
Also known as GHSA-v5f6-hjmf-9mc5, PYSEC-2023-291, UBUNTU-CVE-2023-49297, openSUSE-SU-2024:13493-1, openSUSE-SU-2026:12030-1.