FileRise shared-folder upload path traversal allows arbitrary file write and admin takeover
Description
FileRise before 3.16.0 is vulnerable to path traversal in the shared-folder upload endpoint (/api/folder/uploadToSharedFolder.php), leading to arbitrary file write and administrator account takeover. The upload filename is validated by FolderController with basename() and REGEX_FILE_NAME, which permit URL-encoded sequences (the regex blocks / and \ but not %). The raw filename is then passed to UploadModel::handleUpload, where it is reconstructed as trim(urldecode(basename($fileName))), re-introducing path separators after validation (e.g. ..%2fusers%2fusers.txt becomes ../users/users.txt). UploadNamePolicy::isAllowedForWrite() applies basename() internally and therefore only evaluates the final component (users.txt), allowing the traversal sequence to pass the extension policy. The destination path is then used directly in move_uploaded_file() with no realpath containment check, allowing a write outside the intended upload directory. An attacker who possesses a valid, non-expired, upload-enabled shared-folder link/token (which are designed to be shared publicly) can overwrite users/users.txt to create an administrator account, resulting in unauthenticated admin takeover and, depending on configuration, remote code execution. Exploitation requires possession of a valid, non-expired, upload-enabled shared-folder link/token. This issue is fixed in 3.16.0, which URL-decodes before validation and rejects any path separators in the upload filename.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1Patches
Vulnerability mechanics
Root cause
"Missing URL-decoding before filename validation allows path traversal sequences to bypass the regex filter and be reconstructed after validation."
Attack vector
An attacker who possesses a valid, non-expired, upload-enabled shared-folder link/token (which are designed to be shared publicly) can exploit the path traversal vulnerability. The filename validation permits URL-encoded sequences like `..%2fusers%2fusers.txt` because the regex blocks literal `/` and `\` but not `%`. After validation, `urldecode()` reconstructs the path separators, resulting in `../users/users.txt`. The extension policy only checks the final component (`users.txt`), so the traversal sequence passes. The file is then written outside the intended upload directory via `move_uploaded_file()`, allowing overwrite of `users/users.txt` to create an administrator account, leading to unauthenticated admin takeover and potentially remote code execution [CWE-22].
Affected code
The vulnerability resides in the shared-folder upload endpoint `/api/folder/uploadToSharedFolder.php`. The filename is validated by `FolderController` using `basename()` and `REGEX_FILE_NAME`, which block `/` and `\` but not URL-encoded sequences. The raw filename is then passed to `UploadModel::handleUpload`, where it is reconstructed as `trim(urldecode(basename($fileName)))`, re-introducing path separators after validation. `UploadNamePolicy::isAllowedForWrite()` applies `basename()` internally and only evaluates the final component, allowing traversal sequences to pass the extension policy. The destination path is used directly in `move_uploaded_file()` with no `realpath` containment check.
What the fix does
The advisory states the issue is fixed in version 3.16.0. The fix URL-decodes the filename before validation and rejects any path separators in the upload filename. This ensures that URL-encoded traversal sequences like `%2f` are decoded and detected as path separators before the filename is used in file operations, preventing the bypass. The patch does not show the exact code diff, but the remediation guidance is clear: decode before validating and reject path separators.
Preconditions
- authAttacker must possess a valid, non-expired, upload-enabled shared-folder link/token.
- configThe shared-folder link/token must have upload permissions enabled.
- networkAttacker must be able to reach the `/api/folder/uploadToSharedFolder.php` endpoint over the network.
- inputThe filename must contain URL-encoded path traversal sequences (e.g., `..%2fusers%2fusers.txt`) that bypass the regex validation.
Generated on Jun 19, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2- github.com/error311/FileRise/releases/tag/v3.16.0mitrepatch
- github.com/error311/FileRise/blob/v3.15.0/src/FileRise/Domain/UploadModel.phpmitretechnical-description
News mentions
0No linked articles in our index yet.