Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Security & Privacy | π Major | β‘ Quick win
π§© Analysis chain
π Script executed:
Repository: salimfadhley/dockerized_python_playground
Length of output: 614
π Web query:
uvicorn 0.4.6 security advisory log injection HTTP response splittingπ‘ Result:
Uvicorn version 0.4.6 is affected by two high-severity security vulnerabilities, both of which were addressed in version 0.11.7 [1][2]. 1. HTTP Response Splitting (CVE-2020-7695): Uvicorn versions before 0.11.7 are vulnerable to HTTP response splitting because they fail to properly escape CRLF (carriage return/line feed) sequences in HTTP header values [1][3]. An attacker can exploit this by providing crafted input that results in the insertion of arbitrary HTTP headers or even an arbitrary response body [4][3]. 2. Log Injection and ANSI Escape Sequence Injection (CVE-2020-7694): Uvicorn versions before 0.11.7 are also vulnerable to log injection via ANSI escape sequence injection [2][5]. The server's default request logger processes URLs using urllib.parse.unquote before logging them [6][2]. An attacker can request crafted URLs containing percent-encoded ANSI escape sequences, which, when decoded and logged, can: * Pollute access logs with fake entries [6][5]. * Interact with terminal emulators displaying the logs, potentially leading to unauthorized terminal control [6][5]. Both issues were publicly disclosed and resolved in uvicorn 0.11.7 [1][2]. It is strongly recommended to upgrade to a version later than 0.11.7 to mitigate these risks [5].
Citations:
π Web query:
uvicorn 0.4.6 vulnerabilities CVEπ‘ Result:
Uvicorn version 0.4.6 is affected by two known security vulnerabilities, both of which were addressed in version 0.11.7 [1][2]. The vulnerabilities are: 1. Log Injection (CVE-2020-7694): This vulnerability allows attackers to perform ANSI escape sequence injection through the request logger [2][3]. By requesting crafted URLs, an attacker can pollute access logs or interact with the terminal emulator displaying the logs [4][3]. 2. HTTP Response Splitting (CVE-2020-7695): This vulnerability occurs because CRLF (Carriage Return Line Feed) sequences are not properly escaped in HTTP header values [2][5]. Attackers can exploit this to inject arbitrary headers into HTTP responses or return an arbitrary response body [2][5]. Because version 0.4.6 is significantly older than the patched version (0.11.7), it is recommended to update to a modern, supported version of Uvicorn to mitigate these and other potential security risks [2][6].
Citations:
Update the ASGI server pin too.
uvicorn==0.4.6is still pinned here, and that release is affected by log-injection and HTTP response-splitting issues fixed in0.11.7. Bump it alongside FastAPI.π§° Tools
πͺ OSV Scanner (2.4.0)
[HIGH] 1-1: uvicorn 0.4.6: undefined
(PYSEC-2020-150)
[HIGH] 1-1: uvicorn 0.4.6: undefined
(PYSEC-2020-151)
[HIGH] 1-1: uvicorn 0.4.6: Log injection in uvicorn
(GHSA-33c7-2mpw-hg34)
[HIGH] 1-1: uvicorn 0.4.6: HTTP response splitting in uvicorn
(GHSA-f97h-2pfx-f59f)
π€ Prompt for AI Agents
Source: Linters/SAST tools