Directory Traversal Vulnerability in Flask-CORS Package

python-flask-cors Updated 02 Oct 2025

Summary

31/08/2020
N/A
Yes i
High
7.5

CVE-2020-25032: An issue was discovered in Flask-CORS (aka CORS Middleware for Flask) before 3.0.9. Affects python-flask-cors across 2 version ranges.

< 3.0.9-1 < 91babb941e07a1f45636bdcb75675f13ce1503a2

Fixed in 3.0.9-1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Flask-CORS is a middleware for Flask applications that enables Cross-Origin Resource Sharing (CORS). This package allows developers to configure their Flask applications to accept requests from different origins, enhancing the flexibility of web applications. However, prior to version 3.0.9, Flask-CORS was susceptible to a directory traversal vulnerability that could allow unauthorized access to private resources.

Vulnerability Detail

An issue was discovered in Flask-CORS before version 3.0.9, which allows for directory traversal attacks. This vulnerability arises from improper resource matching that does not ensure pathnames are in a canonical format. As a result, an attacker could exploit this flaw to access sensitive files and resources that should be restricted, potentially leading to data breaches or unauthorized access to critical application components.

How To Fix

Minimum fixed version

3.0.9-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-flask-cors

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, a temporary workaround is to implement additional validation on the input paths to ensure they do not contain any traversal characters (e.g., '../'). This can be done by sanitizing user inputs before processing them.

Conclusion

The directory traversal vulnerability in Flask-CORS poses a significant risk to applications using this middleware. It is crucial for developers to upgrade to the latest version to mitigate potential security threats. Regular monitoring and validation of dependencies can help maintain application security.

See every vulnerability recorded for python-flask-cors →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Flask-CORS versions prior to 3.0.9 are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Exploitation of this vulnerability could lead to unauthorized access to sensitive files and resources, potentially resulting in data breaches.

Yes, upgrading to Flask-CORS version 3.0.9 or later addresses this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for python-flask-cors.

How To Fix

Minimum fixed version

3.0.9-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-flask-cors

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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