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

Flask-CORS allows for inconsistent CORS matching

Flask-CORS normalises request paths with unquote_plus, which turns '+' into a space, so CORS rules can be matched against the wrong path. This can let a request from an untrusted origin be treated as allowed, or block a legitimate one.

corydolphin/flask-cors

Originally disclosed on huntr

A vulnerability in corydolphin/flask-cors version 5.0.1 allows for inconsistent CORS matching due to the handling of the '+' character in URL paths. The request.path is passed through the unquote_plus function, which converts the '+' character to a space ' '. This behavior leads to incorrect path normalization, causing potential mismatches in CORS configuration. As a result, endpoints may not be matched correctly to their CORS settings, leading to unexpected CORS policy application. This can cause unauthorized cross-origin access or block valid requests, creating security vulnerabilities and usability issues.

From the GitHub Advisory Database (GHSA-8vgw-p6qm-5gr7, 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 library normalises the request path with unquote_plus, which decodes '+' as a space, so the path used for CORS matching differs from the actual request path.

Impact

Endpoints may be matched to the wrong CORS settings, which could allow unauthorised cross-origin access or block valid requests.

What the attacker needed

A Flask app using flask-cors 5.0.1; a path containing a '+' character

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 other websites may read responses from a site. Flask-CORS is a library that applies those rules based on the URL path. Here it cleans up the path in a way that changes '+' into a space, so the path it checks is not the real one, and the wrong rule can be applied.

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.