CVE-2024-1681
Log Injection vulnerability in flask-cors (PyPI)

Log Injection No known exploit

What is CVE-2024-1681 About?

This vulnerability allows log injection in corydolphin/flask-cors when debug logging is enabled. Attackers can inject fake log entries via specially crafted GET requests, which can corrupt log files and obscure malicious activities. This is relatively easy to exploit with simple HTTP requests.

Affected Software

flask-cors <4.0.1

Technical Details

The corydolphin/flask-cors library is vulnerable to log injection if the logging level is set to 'debug'. An attacker can send a specially crafted GET request where the request path contains a Carriage Return (CR) and Line Feed (LF) sequence. Due to improper output neutralization for logs, these CRLF sequences are not correctly sanitized before being written to the log file. This allows the attacker to terminate current log entries prematurely and insert new, deceptive log entries, thereby polluting the log file and potentially misleading analysis.

What is the Impact of CVE-2024-1681?

Successful exploitation may allow attackers to corrupt log files, forge log entries, obscure their tracks, and confuse security monitoring tools, potentially aiding further attacks.

What is the Exploitability of CVE-2024-1681?

Exploitation is of low complexity, as it only requires sending a specially crafted GET request containing CRLF sequences in the path. No authentication is required, and no special privileges are needed. This is a remote vulnerability, as the attacker simply sends an HTTP request. The primary condition for exploitation is that the log level must be set to 'debug'. The risk is increased if log files are used for security auditing or incident response.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for CVE-2024-1681?

Available Upgrade Options

  • flask-cors
    • <4.0.1 → Upgrade to 4.0.1

Struggling with dependency upgrades?

See how Resolved Security's drop-in replacements make it simple.

Book a demo

Additional Resources

What are Similar Vulnerabilities to CVE-2024-1681?

Similar Vulnerabilities: CVE-2020-13778 , CVE-2015-3204 , CVE-2015-8120 , CVE-2020-5389 , CVE-2017-1000371