Skip to content
Misconfiguration Disclosed report Beginner CVE-2024-1681

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

The flask-cors library fails to neutralise newline characters in request paths when logging at debug level, allowing an attacker to inject fake log entries. This can corrupt log files, hide other attacks, and mislead log processing tools.

corydolphin/flask-cors

Originally disclosed on huntr

corydolphin/flask-cors is vulnerable to log injection when the log level is set to debug. An attacker can inject fake log entries into the log file by sending a specially crafted GET request containing a CRLF sequence in the request path. This vulnerability allows attackers to corrupt log files, potentially covering tracks of other attacks, confusing log post-processing tools, and forging log entries. The issue is due to improper output neutralization for logs.

From the GitHub Advisory Database (GHSA-84pr-m4jr-85g5, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the library logs the raw request path without escaping or removing carriage return and line feed characters, so an attacker-controlled path can break the log line structure.

Impact

An attacker could corrupt log files, potentially covering tracks of other attacks, confusing log post-processing tools, and forging log entries, but only when the log level is set to debug.

What the attacker needed

Log level set to debug; ability to send a crafted GET request

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a web application logs requests, it writes information like the requested URL into a log file. If the application does not clean up special characters in that URL, an attacker can include newline characters that make the log file show fake entries. This is called log injection and can confuse anyone reading the logs or automated tools that analyse them.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More from corydolphin/flask-cors

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.