CVE-2020-7694 Log Injection

Low 3.7 Published Updated

Attackers can inject ANSI escape sequences into uvicorn logs via crafted URLs, polluting logs and potentially manipulating terminal emulators.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-7694?

CVE-2020-7694 is a low-severity code injection vulnerability in uvicorn, published on 27 Jul 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

This affects all versions of package uvicorn. The request logger provided by the package is vulnerable to ASNI escape sequence injection. Whenever any HTTP request is received, the default behaviour of uvicorn is to log its details to either the console or a log file. When attackers request crafted URLs with percent-encoded escape sequences, the logging component will log the URL after it's been processed with urllib.parse.unquote, therefore converting any percent-encoded characters into their single-character equivalent, which can have special meaning in terminal emulators. By requesting URLs with crafted paths, attackers can: * Pollute uvicorn's access logs, therefore jeopardising the integrity of such files. * Use ANSI sequence codes to attempt to interact with the terminal emulator that's displaying the logs (either in real time or from a file).

Weakness: CWE-94, CWE-116

Which versions are affected by CVE-2020-7694?

3 open source packages ship an affected version, including uvicorn. It affects 1 product.

PackageAffectedFixed in
uvicorn PyPIAll versions0.11.7
uvicorn PyPIAll versions0.11.7
uvicorn PyPIAll versions0.11.7

Products include Encode Uvicorn.

How do I fix CVE-2020-7694?

Upgrade uvicorn to 0.11.7 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2020-7694 being exploited?

There is no known exploitation of CVE-2020-7694 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2020-7694, GHSA-33c7-2mpw-hg34, PYSEC-2020-150, SNYK-PYTHON-UVICORN-575560, UBUNTU-CVE-2020-7694.

Is CVE-2020-7694 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free