CVE-2024-1681: flask-cors vulnerable to log injection when the log level is set to debug
5.3
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.46945%
CWE
Published
4/19/2024
Updated
5/7/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
flask-cors | pip | <= 4.0.0 | 4.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the LOG.debug() call in the cors_after_request handler, which directly logs the raw request.path value. Since request.path is user-controlled and contains CRLF sequences from malicious requests, it gets written to logs without sanitization. This matches the CWE-117 description and the advisory's mention of improper log output neutralization. The code snippet from extension.py line 194 context shows the vulnerable logging pattern.