Spotipy Cross-Site Scripting Vulnerability in OAuth Callback Server

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in Spotipy, a Python library for the Spotify Web API, prior to version 2.25.2. The issue resides in the OAuth callback server, where the error parameter is not properly sanitized, allowing for JavaScript injection. This vulnerability enables attackers to execute arbitrary JavaScript in the user's browser during the OAuth authentication process.

Impact

Exploitation of this vulnerability allows for cross-site scripting, where injected JavaScript is executed in the context of the user's browser.

Reproduction

To reproduce this vulnerability, initiate the OAuth authentication process using Spotipy, which will start a local HTTP server on port 8080. An attacker can then craft a URL that includes a malicious script in the error parameter and send it to the user. When the user clicks the link, the script will execute in their browser.

Remediation

Users can update to Spotipy version 2.25.2 or later, where this vulnerability has been patched.

Added: Nov 27, 2025, 12:17 AM
Updated: Nov 27, 2025, 12:17 AM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
4.2
exploitability
5.4
remediation
7.7
relevance
1.2
threat
6.4
urgency
2.9
incentive
0.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.