PyPI: flask-cors

CVE-2024-1681

Safety vulnerability ID: SFTY-20240419-90883

Safety legacy ID: pyup.io-70624

Affected versions of the flask-cors package are vulnerable to Improper Output Neutralization for Logs due to unsanitized request path values being written to the debug logger. In flask_cors.extension.CORS, request.path is logged via LOG.debug without normalizing or escaping CRLF characters when DEBUG logging is enabled, as evidenced by the logging site in extension.py and the fix that cleans request.path before logging.

Created at: Nov 6, 2025Updated at: Nov 6, 2025

Overview

flask-cors vulnerable to log injection when the log level is set to debug

Advisory

Affected versions of the flask-cors package are vulnerable to Improper Output Neutralization for Logs due to unsanitized request path values being written to the debug logger. In flask_cors.extension.CORS, request.path is logged via LOG.debug without normalizing or escaping CRLF characters when DEBUG logging is enabled, as evidenced by the logging site in extension.py and the fix that cleans request.path before logging.

Affected Package

Affecting flask-cors package, versions<4.0.1

Also affects

---

How to Fix

Upgradeflask-corsto4.0.1or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more