CVE-2021-41281: Path traversal in Matrix Synapse
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.66906%
CWE
Published
11/23/2021
Updated
9/24/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
matrix-synapse | pip | < 1.47.1 | 1.47.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from insufficient validation when constructing file paths from user-controlled inputs. Key evidence includes:
- The patch added _validate_path_component checks to all path-building methods in MediaFilePaths
- Server name validation was added to parse_media_id
- Pre-patch code directly used raw server_name/file_id in os.path.join without sanitization
- The CWE-22 classification confirms path traversal via uncontrolled path elements
- Commit message explicitly mentions preventing writes outside configured directories