CVE-2024-6839
Medium · 4.3Flask-CORS improper regex path matching vulnerability
CVSS
4.3
EPSS
0.7%
Published
Mar 20, 2025
CISA due date
—
Cloudanix analysis
A website or application may accidentally let a malicious website read information from a logged-in user's session if its cross-origin access rules match the wrong page.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Library
- Class
- Misconfiguration
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw is an authorization-boundary weakness in CORS path matching. In affected flask-cors behavior, longer regular-expression path patterns can be selected ahead of more specific intended patterns, causing an endpoint to inherit a broader or less restrictive CORS policy than the application developer expected. If a sensitive route is matched by the wrong CORS rule, the application may emit permissive Access-Control-Allow-Origin and related headers to an untrusted origin. This does not usually allow unauthenticated direct access by itself, but it can allow attacker-controlled web pages to read responses or trigger browser-authenticated actions when a victim already has a valid session and the application allows credentialed cross-origin requests.
Why it matters to the business
Organizations may unintentionally expose sensitive monitoring, administrative, or application data to malicious websites visited by authenticated users. The operational risk is lower than a direct remote code execution issue, reflected by the moderate CVSS score and low EPSS, and it is not listed in CISA KEV or known ransomware use. However, because CORS mistakes can silently bypass browser same-origin protections, affected internet-facing web applications or administrative interfaces should still be remediated, especially where privileged users access them from browsers. For the affected Debian Zabbix packages and Zabbix source builds, applying the listed fixed versions reduces the risk of cross-origin data exposure or unauthorized browser-mediated actions.
How an attack unfolds
An attacker first identifies an application using a vulnerable CORS policy implementation and maps endpoints with overlapping regular-expression CORS rules. They then determine whether a sensitive endpoint receives a permissive CORS response because a longer but less specific regex pattern is prioritized over the intended restrictive one. If the endpoint allows credentialed browser requests, the attacker hosts a malicious web page that sends fetch or XMLHttpRequest calls to the vulnerable endpoint with an Origin header controlled by the attacker. When an authenticated user visits the malicious page, the victim browser automatically includes applicable cookies or credentials. If the vulnerable application returns Access-Control-Allow-Origin for the attacker origin and permits credentials, the attacker's script can read the response or potentially invoke sensitive actions that the victim is authorized to perform. Successful exploitation depends on the application's CORS configuration, session model, endpoint sensitivity, and whether credentials are allowed cross-origin.
How to fix it
Upgrade affected packages to fixed versions. For Debian 11 Zabbix packages, update to 1:5.0.44+dfsg-1+deb11u1 or later. For Debian 13 Zabbix packages, update to 1:7.0.5+dfsg-1 or later. For Zabbix source builds from Git, include commit 55e9f3b67c4db700b4946f166e69a401b93e2598 or a later release containing that fix. For applications directly using flask-cors, upgrade away from vulnerable 4.0.1 behavior to a fixed upstream version when available through the application's dependency manager. In addition to patching, review CORS configuration for overlapping regex patterns; avoid broad wildcard or catch-all rules on authenticated or sensitive routes; prefer explicit path allowlists; do not combine permissive origins with Access-Control-Allow-Credentials unless absolutely required; and ensure sensitive state-changing endpoints also enforce CSRF protections and server-side authorization checks independent of CORS.
How to confirm the fix worked
Confirm the installed package or source revision is at or beyond the fixed version: Debian 11 Zabbix at 1:5.0.44+dfsg-1+deb11u1 or later, Debian 13 Zabbix at 1:7.0.5+dfsg-1 or later, and Zabbix Git builds containing commit 55e9f3b67c4db700b4946f166e69a401b93e2598 or later. For Python applications, inspect dependency lockfiles and runtime package inventories for flask-cors 4.0.1 and verify it has been replaced with a fixed version. Functionally test representative sensitive endpoints by sending requests with untrusted Origin values and confirming the response does not allow that origin and does not return Access-Control-Allow-Credentials: true for unauthorized origins. Test overlapping CORS regex patterns specifically, including longer broad patterns and shorter sensitive-path patterns, to confirm the most restrictive intended rule applies. Review automated tests to ensure CORS decisions are asserted per endpoint rather than only at a global level.
Typical attack path
- Identify an application or package version that uses the affected CORS path-matching logic.
- Enumerate routes and CORS behavior by sending requests with attacker-controlled Origin headers to sensitive and non-sensitive paths.
- Find an overlapping regex case where a sensitive endpoint receives a less restrictive CORS policy than intended.
- Verify whether responses include permissive CORS headers such as Access-Control-Allow-Origin reflecting the attacker origin and, if applicable, Access-Control-Allow-Credentials: true.
- Create a malicious web page that makes browser-based cross-origin requests to the affected endpoint.
- Entice or wait for an authenticated user to browse to the malicious page.
- Use the victim browser's authenticated context to read exposed data or trigger allowed actions through the misapplied CORS policy.
How to detect it
There is no reliable universal exploit signature for this vulnerability because exploitation looks like normal browser traffic with an Origin header. To assess possible prior exploitation, review web server, application, API gateway, CDN, and reverse-proxy logs for requests to sensitive endpoints that include Origin values not on the approved allowlist. Pay particular attention to successful responses where the application returned Access-Control-Allow-Origin matching an untrusted origin, Access-Control-Allow-Credentials: true, or both. Correlate OPTIONS preflight requests with subsequent credentialed GET, POST, PUT, PATCH, or DELETE requests from the same client, user, session, or source IP. Look for browser request headers that indicate cross-site navigation or subresource access, such as Sec-Fetch-Site: cross-site, combined with session cookies and successful 2xx responses. Investigate unusual Referer values, unexpected high-volume reads of sensitive API endpoints, or access patterns immediately following visits to external sites. If response headers are not logged, reproduce historical exposure through archived configurations and deployment versions, then scope users and endpoints that were reachable while vulnerable. Endpoint telemetry may not show the malicious hosting page, so network logs, proxy logs, and browser telemetry, where available, are useful for identifying suspicious external origins.
What your security team should do
- Prioritize patching affected internet-facing or administrator-facing web interfaces where authenticated browser sessions are common.
- Upgrade Debian Zabbix packages to 1:5.0.44+dfsg-1+deb11u1 on Debian 11 and 1:7.0.5+dfsg-1 on Debian 13, and ensure source builds include commit 55e9f3b67c4db700b4946f166e69a401b93e2598 or later.
- Inventory applications using flask-cors and flag version 4.0.1 or configurations with overlapping regex-based CORS resources for review.
- Audit CORS rules for sensitive endpoints and remove wildcard, reflection-based, or overly broad origin allowances where credentials are accepted.
- Add regression tests that send hostile Origin headers to sensitive routes and fail builds if permissive CORS headers are returned unexpectedly.
- Monitor web and reverse-proxy logs for cross-site authenticated requests to sensitive endpoints, especially OPTIONS preflights followed by successful GET, POST, PUT, PATCH, or DELETE requests from unusual origins.
- Because EPSS is low and there is no KEV listing, treat this as a configuration-sensitive remediation item rather than an emergency, unless sensitive data-bearing endpoints are exposed to browsers with credentialed CORS enabled.
The record
corydolphin/flask-cors version 4.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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | flask-cors | 0 | 6.0.0 |
| Chainguard | kubeflow-jupyter-web-app | 0 | 1.10.0-r3 |
| Chainguard | kubeflow-volumes-web-app | 0 | 1.10.0-r2 |
| Chainguard | superset-6.0 | 0 | 6.0.0-r2 |
| Debian:11 | python-flask-cors | 0 | No fix |
| Debian:12 | python-flask-cors | 0 | No fix |
| Debian:13 | python-flask-cors | 0 | No fix |
| Debian:13 | python-flask-cors | 0 | 6.0.0-1 |
| Debian:14 | python-flask-cors | 0 | 6.0.1-1 |
| Mageia:9 | python-flask-cors | 0 | 3.0.10-1.1.mga9 |
| Wolfi | kubeflow-jupyter-web-app | 0 | 1.10.0-r3 |
| Wolfi | kubeflow-volumes-web-app | 0 | 1.10.0-r2 |
| Wolfi | superset-6.0 | 0 | 6.0.0-r2 |
| openSUSE:Tumbleweed | python-Flask-Cors | 0 | 6.0.2-1.1 |
Related vulnerabilities
- CVE-2024-6844 Flask-CORS allows for inconsistent CORS matching Also affects flask-cors
- CVE-2024-6866 Flask-CORS vulnerable to Improper Handling of Case Sensitivity Also affects flask-cors
- CVE-2024-6221 A vulnerability in corydolphin/flask-cors version 4.0.1 allows the… Also affects flask-cors
- CVE-2024-1681 corydolphin/flask-cors is vulnerable to log injection when the log level is set to debug. Also affects flask-cors
- CVE-2026-34073 cryptography is a package designed to expose cryptographic primitives and recipes to… Also affects kubeflow-jupyter-web-app
- CVE-2026-25645 Requests is a HTTP library. Also affects kubeflow-jupyter-web-app
- CVE-2026-30922 pyasn1 is a generic ASN.1 library for Python. Also affects kubeflow-jupyter-web-app
- CVE-2026-26007 cryptography is a package designed to expose cryptographic primitives and recipes to… Also affects kubeflow-jupyter-web-app