Flask-CORS vulnerable to Improper Handling of Case Sensitivity
Flask-CORS uses a case-insensitive regex match for request paths, so paths that should be restricted are treated as matching allowed paths regardless of case. An attacker could use an unauthorised origin to access restricted paths, leading to data exposure.
corydolphin/flask-cors
Originally disclosed on huntr
corydolphin/flask-cors version 5.0.1 contains a vulnerability where the request path matching is case-insensitive due to the use of the try_match function, which is originally intended for matching hosts. This results in a mismatch because paths in URLs are case-sensitive, but the regex matching treats them as case-insensitive. This misconfiguration can lead to significant security vulnerabilities, allowing unauthorized origins to access paths meant to be restricted, resulting in data exposure and potential data leaks.
From the GitHub Advisory Database (GHSA-43qf-4rqw-9q2g, CC BY 4.0).
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 reused a host-matching function that performs case-insensitive regex matching for path matching, where case-sensitive comparison is required.
Impact
Unauthorised origins could access paths meant to be restricted, resulting in data exposure and potential data leaks.
What the attacker needed
None
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.
A web library that controls which websites can read data from an application was checking the path part of a web address without caring about upper or lower case letters. But web addresses are case-sensitive, so a path like '/Admin' could be treated the same as '/admin', letting a site that should be blocked read data it should not.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.