CVE-2025-66040: Spotipy Has a XSS Vulnerability
Affects spotipySource GCVE Database
Not known to be exploited · CVSS 3.6 Low : upgrade to 2.25.2 when convenient.
Data as of 21 Nov 2026, 03:38 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 3.1 | 3.6 |
|---|
- Patch
- Available – fixed in 2.25.2
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:NExploitation evidence
Disclosed: evidence found.
CVE published 26 Nov 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 20 Nov 2026.
What to do
Upgrade spotipy to 2.25.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIspotipy | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in spotipy version 2.25.2 that fixes this vulnerability by applying HTML escaping to the 'error' parameter before reflecting it in the OAuth callback server's HTML response. Users and administrators should upgrade to version 2.25.2 or later to remediate this issue. No additional mitigations are required once the patch is applied.
Description
Spotipy versions prior to 2.25.2 contain a cross-site scripting (XSS) vulnerability in the OAuth callback server. The vulnerability arises because the local HTTP server used during OAuth authentication reflects the 'error' URL parameter into HTML without proper sanitization. This allows an attacker to inject arbitrary JavaScript code that executes in the user's browser on the localhost origin. The vulnerability requires user interaction and timing during the OAuth flow. A fix is available in version 2.25.2 that applies HTML escaping to the reflected error parameter.
References
- github.com/spotipy-dev/spotipy/security/advisories/GHSA-r77h-rpp9-w2xm (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2025-66040 (opens in a new tab)
- github.com/spotipy-dev/spotipy/commit/880b92d7243dcf2b83bf31dc365a858d8b5e6767 (opens in a new tab)
- github.com/spotipy-dev/spotipy (opens in a new tab)