# CVE-2025-66040: PYSEC-2026-1937 - Spotipy has a XSS vulnerability in its OAuth callback server

Source: https://junglewise.ai/threats/cve-2025-66040-spotipy-has-a-xss-vulnerability-in-its-oauth-callback-server  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-11-27  
License: CC BY 4.0 with a link back

CVE-2025-66040 · Severity: low · CVSS 3.6 · Published 2025-11-27

Spotipy is a Python library for the Spotify Web API. Prior to version 2.25.2, there is a cross-site scripting (XSS) vulnerability in the OAuth callback server that allows for JavaScript injection through the unsanitized error parameter. Attackers can execute arbitrary JavaScript in the user's browser during OAuth authentication. This issue has been patched in version 2.25.2.

Technologies: [spotipy (PyPI)](https://junglewise.ai/threats/technologies/spotipy). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2025-66040 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-66040 being exploited in the wild.

**How severe is CVE-2025-66040?** Low severity, with a CVSS score of 3.6, published 27 November 2025.

**Which products and versions are affected?** spotipy (PyPI) ECOSYSTEM:introduced=0,fixed=2.25.2.

**Is there a fix for CVE-2025-66040?** Yes. spotipy (PyPI): upgrade to 2.25.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2025-66040?** Check whether you run spotipy (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- spotipy (PyPI): upgrade to 2.25.2 or later

  ```sh
  pip install "spotipy>=2.25.2"
  ```


## Affected products

- spotipy (PyPI) ECOSYSTEM:introduced=0,fixed=2.25.2

## Identifiers

- CVE-2025-66040
- GHSA-r77h-rpp9-w2xm
- PYSEC-2026-1937

## Related threats

- [PYSEC-2026-1936 - Spotipy's cache file, containing spotify auth token, is created with overly broad permissions](https://junglewise.ai/threats/cve-2025-27154-spotipy-s-cache-file-containing-spotify-auth-token-is-created)
- [PYSEC-2026-926 - Path traversal in spotipy](https://junglewise.ai/threats/cve-2023-23608-path-traversal-in-spotipy)
