# CVE-2024-1681: Log Injection Vulnerability in corydolphin/flask-cors

> Attackers can inject fake log entries via CRLF sequences in request paths when debug logging is enabled, corrupting logs and hiding malicious activity.

- **Severity:** Medium 5.3 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Apr 2024
- **Updated:** 3 Nov 2025
- **Also known as:** DEBIAN-CVE-2024-1681, GHSA-84pr-m4jr-85g5, OESA-2024-1713, PYSEC-2024-271, ROOT-APP-PYPI-CVE-2024-1681, UBUNTU-CVE-2024-1681, openSUSE-SU-2024:14293-1

## What is CVE-2024-1681?

CVE-2024-1681 is a medium-severity vulnerability in corydolphin/flask-cors, published on 19 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-117 (Improper Output Neutralization for Logs)

## Which versions are affected by CVE-2024-1681?

3 open source packages ship an affected version, including flask-cors. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `flask-cors` | PyPI | All versions to 4.0.0 | None |
| `flask-cors` | PyPI | All versions | 4.0.1 |
| `flask-cors` | PyPI | All versions | 4.0.1 |
| `python-Flask-Cors` | openSUSE:Tumbleweed | All versions | 4.0.1-1.1 |

Products: Corydolphin Flask-Cors.

## How do I fix CVE-2024-1681?

Upgrade flask-cors to 4.0.1 or later.

## Is CVE-2024-1681 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-1681 exists.

## Other vulnerabilities in corydolphin/flask-cors

- [CVE-2024-6221](https://insights.sbomify.com/CVE-2024-6221/): Improper Access Control in corydolphin/flask-cors (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-1681 and fix it if it is affected.

What it is: CVE-2024-1681 is a medium-severity vulnerability in corydolphin/flask-cors, published on 19 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-1681 exists.

Affected packages and fixed versions:
- flask-cors (PyPI): affected all versions up to 4.0.0; no fix listed
- flask-cors (PyPI): affected all versions; fixed in 4.0.1
- flask-cors (PyPI): affected all versions; fixed in 4.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-1681/ (Markdown: https://insights.sbomify.com/CVE-2024-1681/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-1681
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-1681
- OSV: https://osv.dev/vulnerability/CVE-2024-1681

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-1681/
Summaries are generated and may contain mistakes; the official description above is the record.
