What’s Vulnerable › Vulnerabilities

CVE-2025-27154: Spotipy's cache file, containing spotify auth token, is created with overly broad permissions

Description

Spotipy is a lightweight Python library for the Spotify Web API. The `CacheHandler` class creates a cache file to store the auth token. Prior to version 2.25.1, the file created has `rw-r--r--` (644) permissions by default, when it could be locked down to `rw-------` (600) permissions. This leads to overly broad exposure of the spotify auth token. If this token can be read by an attacker (another user on the machine, or a process running as another user), it can be used to perform administrative actions on the Spotify account, depending on the scope granted to the token. Version 2.25.1 tightens the cache file permissions.

Affected products

How to fix

Upgrade to a fixed version: spotipy-dev spotipy 2.25.1. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2025-27154 or the next vulnerability affects your stack