CVE-2023-23608
JSON

0.0none

spotipy Path traversal vulnerability that may lead to type confusion in URI handling code

Severity
0.0none CVSS:3.1 by GitHub_M
Exploit likelihood
0.69% (higher than 54% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-q764-g6fm-555vPYSEC-2026-926

Description

Spotipy is a light weight Python library for the Spotify Web API. In versions prior to 2.22.1, if a malicious URI is passed to the library, the library can be tricked into performing an operation on a different API endpoint than intended. The code Spotipy uses to parse URIs and URLs allows an attacker to insert arbitrary characters into the path that is used for API requests. Because it is possible to include "..", an attacker can redirect for example a track lookup via spotifyApi.track() to an arbitrary API endpoint like playlists, but this is possible for other endpoints as well. The impact of this vulnerability depends heavily on what operations a client application performs when it handles a URI from a user and how it uses the responses it receives from the API. This issue is patched in version 2.22.1.

Affected

Product or packageVersionsReported by
spotipy-dev spotipy< 2.22.1CVE List
spotipy (PyPI)before 2.22.1GitHub Advisory Database, PyPA Advisory Database
spotipy_project spotipybefore 2.22.1NVD

All scores

GitHub_M0.0none CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:N
GitHub5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L
NVD4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
PyPA Advisory Database5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Spotipy is a light weight Python library for the Spotify Web API. In versions prior to 2.22.1, if a malicious URI is passed to the library, the library can be tricked into performing an operation on a different API endpoint than intended. The code Spotipy uses to parse URIs and URLs allows an attacker to insert arbitrary characters into the path that is used for API requests. Because it is possible to include "..", an attacker can redirect for example a track lookup via spotifyApi.track() to an arbitrary API endpoint like playlists, but this is possible for other endpoints as well. The impact of this vulnerability depends heavily on what operations a client application performs when it handles a URI from a user and how it uses the responses it receives from the API. This issue is patched in version 2.22.1.

GitHub Advisory Database
Summary

If a malicious URI is passed to the library, the library can be tricked into performing an operation on a different API endpoint than intended.

Details

The code Spotipy uses to parse URIs and URLs accepts user data too liberally which allows a malicious user to insert arbitrary characters into the path that is used for API requests. Because it is possible to include .., an attacker can redirect for example a track lookup via spotifyApi.track() to an arbitrary API endpoint like playlists, but this is possible for other endpoints as well.

Before the security advisory feature was enabled on GitHub, I was already in contact with Stéphane Bruckert via e-mail, and he asked me to look into a potential fix.

My recommendation is to perform stricter parsing of URLs and URIs, which I implemented in the patch included at the end of the report. If you prefer, I can also invite you to a private fork of the repository.

Impact

The impact of this vulnerability depends heavily on what operations a client application performs when it handles a URI from a user and how it uses the responses it receives from the API.

NVD (es)

Spotipy es una librería Python liviana para la API web de Spotify. En versiones anteriores a la 2.22.1, si se pasa un URI malicioso a la librería, se puede engañar a la librería para que realice una operación en un endpoint de API diferente al previsto. El código que utiliza Spotipy para analizar URI y URL permite a un atacante insertar caracteres arbitrarios en la ruta que se utiliza para las solicitudes de API. Debido a que es posible incluir "..", un atacante puede redirigir, por ejemplo, una búsqueda de pistas a través de spotifyApi.track() a un endpoint API arbitrario como listas de reproducción, pero esto también es posible para otros endpoints. El impacto de esta vulnerabilidad depende en gran medida de las operaciones que realiza una aplicación cliente cuando maneja un URI de un usuario y cómo utiliza las respuestas que recibe de la API. Este problema se solucionó en la versión 2.22.1.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-23608 changed 2025-03-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-q764-g6fm-555v changed 2026-09-10CC-BY-4.0
NVDCVE-2023-23608 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-926 changed 2026-07-07CC-BY-4.0