Remote Code Execution Risk in Flask-Caching Package Due to Pickle Serialization Flaw

flask-caching Updated 02 Oct 2025

Summary

13/05/2021
N/A
No i
Unrated
Not published

DEBIAN-CVE-2021-33026: The Flask-Caching extension through 1.10.1 for Flask relies on Pickle for serialization, which may lead to remote code execution or local privilege escalation. Affects flask-caching versions 1.10.1-1 – 2.3.1-1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Flask-Caching is an extension for Flask that provides caching capabilities to enhance the performance of web applications. It supports various backends such as filesystem, Memcached, and Redis. The package is widely used in Python web development to optimize response times by storing frequently accessed data. However, a critical vulnerability has been identified in versions up to 1.10.1, where the reliance on Pickle for serialization poses significant security risks.

Vulnerability Detail

The vulnerability arises from the use of Pickle for serialization in Flask-Caching, which can lead to remote code execution or local privilege escalation. If an attacker gains access to the cache storage (e.g., filesystem, Memcached, Redis), they can craft a malicious payload, poison the cache, and execute arbitrary Python code. Although exploitation is deemed unlikely unless the machine is already compromised, it remains a serious concern as it could allow unauthorized access and control over the affected system.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, consider disabling caching or using a different serialization method that does not rely on Pickle. This can help mitigate the risk until the package is updated. Additionally, ensure that access to cache storage is restricted to trusted users only.

Conclusion

The vulnerability in Flask-Caching due to the use of Pickle for serialization poses significant security risks, including remote code execution. It is crucial for users to update to a patched version and consider workarounds to secure their applications. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.

See every vulnerability recorded for flask-caching →

Share this vulnerability

FAQ

Flask-Caching is an extension for Flask that provides caching mechanisms to improve the performance of web applications.

The vulnerability involves the use of Pickle for serialization, which can be exploited to execute arbitrary code if an attacker gains access to the cache.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability could lead to remote code execution or local privilege escalation, allowing attackers to gain unauthorized access to the system.

Yes, a patched version of Flask-Caching is available. It is recommended to update to a version greater than 1.10.1 to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for flask-caching.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback