Skip to content
CORS Disclosed report Intermediate CVE-2024-6839

Flask-CORS improper regex path matching vulnerability

Flask-CORS version 5.0.1 prioritises longer regex patterns over more specific ones when matching paths, so a less restrictive CORS policy may be applied to sensitive endpoints. An attacker could then make unauthorised cross-origin requests to those endpoints, potentially accessing confidential data or functionality.

corydolphin/flask-cors

Originally disclosed on huntr

corydolphin/flask-cors version 5.0.1 contains an improper regex path matching vulnerability. The plugin prioritizes longer regex patterns over more specific ones when matching paths, which can lead to less restrictive CORS policies being applied to sensitive endpoints. This mismatch in regex pattern priority allows unauthorized cross-origin access to sensitive data or functionality, potentially exposing confidential information and increasing the risk of unauthorized actions by malicious actors.

From the GitHub Advisory Database (GHSA-7rxf-gvfg-47g4, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the path-matching logic sorts or selects regex patterns by length rather than by specificity, so a broader pattern can win over a narrower one.

Impact

A malicious site could make cross-origin requests to sensitive endpoints and potentially read confidential information or perform unauthorised actions.

What the attacker needed

Victim visits a malicious site; app uses flask-cors 5.0.1 with regex paths

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

CORS is a browser rule that decides which websites may read responses from another site. This library lets developers allow cross-origin access by matching URL paths against patterns, but it picks the wrong pattern when two match, so a strict rule can be overridden by a looser one. That means a malicious website could read data from a sensitive part of the application that should have been protected.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

More from corydolphin/flask-cors

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.