PHP2Shell: Read our blog on the critical RCE vulnerabilities affecting 70% of the Internet

CVE-2025-27154: 
Python vulnerability analysis and mitigation

Overview

Spotipy, a lightweight Python library for the Spotify Web API, was found to have a security vulnerability (CVE-2025-27154) in versions prior to 2.25.1. The vulnerability stems from the CacheHandler class creating a cache file to store authentication tokens with overly permissive file permissions (644 or rw-r--r--) instead of more restrictive permissions (600 or rw-------). This vulnerability was discovered and disclosed on February 27, 2025, affecting all versions of Spotipy up to version 2.25.0 (GitHub Advisory, NVD).

Technical details

The vulnerability exists in the CacheHandler class implementation where the cache file storing Spotify authentication tokens is created with default permissions of 644 (rw-r--r--). These permissions allow the file to be readable by other users on the same system, potentially exposing sensitive authentication tokens. The vulnerability has been assigned a CVSS v4.0 base score of 8.4 (High), with the vector string CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N. The issue is classified as CWE-276 (Incorrect Default Permissions) (GitHub Advisory).

Impact

The vulnerability's impact is significant as it could lead to unauthorized access to users' Spotify accounts. If an attacker gains access to the authentication token, they could perform administrative actions on the Spotify account depending on the scope granted to the token. Potential malicious actions include exfiltrating spotify likes and saved playlists, deleting content, or modifying content without permission. The impact is particularly severe in multi-user environments or systems where the home directory has broad read permissions (Security Online, GitHub Advisory).

Exploitability

The vulnerability requires local access to the affected system and can be exploited by another user on the machine or a process running as another user. The exploitation is straightforward and requires no special conditions beyond the ability to read files with world-readable permissions. The vulnerability is particularly exploitable when combined with other misconfigurations, such as having o+r permissions set on the user's home directory (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in Spotipy version 2.25.1, which changes the default cache file permissions to 600 (rw-------). Users are strongly encouraged to upgrade to this version, especially if running Spotipy in a multi-user environment or managing multiple users' auth tokens. The fix involves adding an explicit os.chmod() call to set the file permissions to 0o600 after creating the cache file (GitHub Release, GitHub Commit).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

sid

spotipy: 2.25.1-1

Fixed

trixie

spotipy: 2.25.1-1

Fixed

Ubuntu

Unknown

devel

spotipy

Unknown

resolute

spotipy

Unknown

resolute (esm-apps)

spotipy

Unknown

Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-57121HIGH8.1
  • Python logoPython
  • praisonai-platform
NoYesOct 23, 2026
GHSA-249c-7rgc-f52hHIGH7.5
  • Python logoPython
  • svglib
NoYesOct 23, 2026
GHSA-h8jf-9f4f-2v9hMEDIUM6.8
  • Python logoPython
  • docling
NoYesOct 23, 2026
CVE-2026-54711LOW2.4
  • Python logoPython
  • pghoard
NoNoOct 23, 2026
GHSA-g536-hq2j-5mpfLOWN/A
  • Python logoPython
  • openai4s
NoNoOct 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management