# CVE-2024-6221: Flask-Cors improper access control in Private Network Access header

Source: https://junglewise.ai/threats/cve-2024-6221-flask-cors-improper-access-control-in-private-network-access  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-08-18. Updated: 2026-05-19  
License: CC BY 4.0 with a link back

CVE-2024-6221 · Severity: high · CVSS 7.5 · Published 2024-08-18

A vulnerability in the Flask-Cors library, which manages cross-origin resource sharing for web applications, could allow external websites to access resources on a company's private internal network. By default, the library incorrectly signals to web browsers that private network requests are permitted, potentially exposing sensitive internal data or services to unauthorized parties. This could lead to data breaches or unauthorized access to internal systems that were intended to be isolated from the public internet.

Technologies: [Flask-Cors (PyPI)](https://junglewise.ai/threats/technologies/flask-cors). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-6221 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-6221 being exploited in the wild.

**How severe is CVE-2024-6221?** High severity, with a CVSS score of 7.5, published 18 August 2024.

**Which products and versions are affected?** Flask-Cors (PyPI) < 4.0.2, ECOSYSTEM:introduced=0,fixed=4.0.2, ECOSYSTEM:introduced=0,last_affected=4.0.1.

**Is there a fix for CVE-2024-6221?** Yes. Flask-Cors (PyPI): upgrade to 4.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-6221 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-6221?** Check whether you run Flask-Cors (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Flask-Cors (PyPI): upgrade to 4.0.2 or later

  ```sh
  pip install "Flask-Cors>=4.0.2"
  ```


## Technical details

A vulnerability in Flask-Cors version 4.0.1 (and earlier) causes the 'Access-Control-Allow-Private-Network' CORS header to be set to 'true' by default without a configuration option to disable it. This behavior violates the Private Network Access (PNA) specification, which is designed to prevent public websites from making unauthorized requests to internal or local network endpoints. An attacker can exploit this by hosting a malicious website that, when visited by a user inside a private network, can successfully perform cross-origin requests to internal services that use the vulnerable Flask-Cors configuration. This can result in the unauthorized disclosure of sensitive information from internal APIs. The issue is resolved in version 4.0.2.

## Affected products

- corydolphin Flask-Cors < 4.0.2

## Identifiers

- CVE-2024-6221
- GHSA-hxwh-jpp2-84pm
- PYSEC-2024-260
- PYSEC-2024-71

## Timeline

- 2024-08-18: advisory: GitHub Advisory published
- 2024-08-18: disclosed: NVD publication date

## References

- [https://api.github.com/users/adrianosela](https://api.github.com/users/adrianosela)
- [https://github.com/adrianosela](https://github.com/adrianosela)
- [https://api.github.com/users/adrianosela/gists%7B/gist_id%7D](https://api.github.com/users/adrianosela/gists%7B/gist_id%7D)
- [https://api.github.com/users/adrianosela/repos](https://api.github.com/users/adrianosela/repos)
- [https://avatars.githubusercontent.com/u/16856511?v=4](https://avatars.githubusercontent.com/u/16856511?v=4)
- [https://api.github.com/users/adrianosela/events%7B/privacy%7D](https://api.github.com/users/adrianosela/events%7B/privacy%7D)

## Related threats

- [PYSEC-2026-1385 - Flask-CORS allows for inconsistent CORS matching](https://junglewise.ai/threats/cve-2024-6844-flask-cors-allows-for-inconsistent-cors-matching)
- [PYSEC-2026-1384 - Flask-CORS improper regex path matching vulnerability](https://junglewise.ai/threats/cve-2024-6839-flask-cors-improper-regex-path-matching-vulnerability)
- [PYSEC-2026-1383 - Flask-CORS vulnerable to Improper Handling of Case Sensitivity](https://junglewise.ai/threats/cve-2024-6866-flask-cors-vulnerable-to-improper-handling-of-case-sensitivity)
- [corydolphin flask-cors log injection in debug mode](https://junglewise.ai/threats/cve-2024-1681-corydolphin-flask-cors-log-injection-in-debug-mode)
- [Flask-Cors Directory Traversal vulnerability](https://junglewise.ai/threats/cve-2020-25032-flask-cors-directory-traversal-vulnerability)
