CVE-2022-35920:
sanic vulnerable to Path Traversal when using `app.static` if using encoded `%2F` URLs
8.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.48974%
CWE
Published
8/6/2022
Updated
1/31/2023
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
sanic | pip | >= 22.0.0, < 22.6.1 | 22.6.1 |
sanic | pip | >= 21.0.0, < 21.12.2 | 21.12.2 |
sanic | pip | < 20.12.7 | 20.12.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how Sanic's static file handler processes URL paths. The _static_request_handler in routes.py initially checked for '../' in the raw URL path but did not properly handle URL-decoded paths containing '%2F' (encoded slashes). This allowed lateral directory traversal when the URL was unquoted. The patch in PR #2495 modified this handler to check the decoded URI for traversal patterns, confirming this as the vulnerable function. The file path and function name are evident from the commit diff analysis and the security advisory context.