CVE Watchtower

CVE-2026-115896error311/FileRise Unrestricted File Upload

NVD

Vulnerability Summary

Vulnerability Report — error311/FileRise (Finding #3) Title: Trailing-dot filename bypasses `UploadNamePolicy`'s executable-extension blocklist across uploads, renames, and WebDAV writes Affected package: `error311/FileRise` Affected version confirmed: v3.22.0 (latest release) and current `master` Component: `src/FileRise/Support/UploadNamePolicy.php::isAllowedForWrite()` CWE: CWE-434 (Unrestricted Upload of File with Dangerous Type), CWE-697 (Incorrect Comparison) Suggested severity: Medium (CVSS 3.1 estimate: `AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N` ≈ 4.0–5.5 depending on server/OS specifics — see scoping notes; could rise to High if the deployment's web server treats a trailing-dot filename as executable, which the reporter has not confirmed end-to-end) --- 1. Summary `UploadNamePolicy::isAllowedForWrite()` is the single choke-point function FileRise uses to decide whether a filename is safe to write to disk. It is called from the regular upload path, the resumable/chunked upload path, file renames, folder renames, and — per the already-fixed GHSA-46gv-gf5f-wvr2 advisory — the WebDAV write path as well. A logic error in its default ("strict") mode allows an attacker to bypass the entire executable-extension blocklist simply by appending a trailing dot to a blocked extension. 2. Root Cause ```php $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); if ($ext !== '' && in_array($ext, self::STRICT_BLOCKED_EXTENSIONS, true)) { return false; } return true; ``` I verified directly with PHP 8.3 (used the same test as for a prior finding on a different project this session): ``` $ php -r 'var_dump(pathinfo("shell.php.", PATHINFO_EXTENSION));' string(0) "" ``` For a filename like `shell.php.` (a literal trailing dot after the blocked extension), `pathinfo()` returns an empty string. Because the blocklist check is guarded by `$ext !== ''`, an empty extension causes the entire `in_array(...)` check to be skipped — the filename is accepted with `return true` at the end of the function, having never been compared against `STRICT_BLOCKED_EXTENSIONS` (`php`, `phtml`, `pht`, `phar`, `cgi`, `fcgi`, `pl`, `py`, `sh`, `jsp`, `asp`, etc.) at all. Critically, unlike a similar bug I identified in a different PHP file-manager project this session, this function does not rename or strip anything from the filename — the earlier check in the same function only rejects if `basename($fileName) !== $fileName` (i.e., it contains a path separator), and separately validates against `REGEX_FILE_NAME`: ```php define('REGEX_FILE_NAME', '/^[^\x00-\x1F\/\\\\]{1,255}$/u'); ``` This regex only excludes control characters and path separators — it does not forbid a trailing dot. So `shell.php.` passes `REGEX_FILE_NAME`, passes the (skipped) extension blocklist, and is written to disk with that exact literal name, trailing dot included. 3. Where this is reachable `isAllowedForWrite()` is called from, at minimum: - `UploadModel::normalizeUploadFileName()` (regular upload path) and other call sites in `UploadModel.php` (resumable/chunked uploads). - `FileModel.php` (rename, in `isAllowedForWrite($newName)` and related list-filtering logic). - `FolderModel.php` (rename-within-folder logic). - `FileRiseFile::isAllowedWebDavFileName()` (WebDAV `PUT`). I did not find any additional content-based MIME/type check (e.g., `finfo`/`mime_content_type` gating the write) alongside any of these call sites — the filename-extension check in `UploadNamePolicy` is the primary line of defense against executable uploads in "strict" mode (the default `safeUploadPolicy`), so a bypass here affects the whole application, not just one upload surface. 4. Impact and honest scoping Whether this results directly in remote code execution depends on how the underlying OS/web server treats a filename ending in a literal dot: - On some platforms/configurations (notably legacy Windows/IIS filesystem behavior, and some Apache configurations using `mod_negotiation`/loose extension matching), a trailing dot in a stored filename can be silently normalized away or otherwise cause the file to be treated as if it had the extension before the dot — the same mechanism that made the analogous bug in other PHP upload tools (e.g., CVE-2024-21546 in `unisharp/laravel-filemanager`) result in confirmed RCE. - On a typical Linux + Apache/Nginx + PHP-FPM stack with a standard `\.php$` (end-of-string-anchored) handler mapping, requesting the literal path `.../shell.php.` would not usually match that handler, so exploitability there is less clear-cut. I have not built a live FileRise instance to confirm end-to-end execution, and I want to be upfront about that rather than overstate the finding. What I have concretely verified is: (a) the blocklist is bypassed and (b) the dangerous file is written to disk with the blocked extension still present in its name, literally, for every write path that relies on this function. That is a real defect regardless of which web servers happen to additionally protect against it — the blocklist is not doing what it is named and intended to do. 5. Reproduction (logic-level, not yet demonstrated live) 1. As any user with upload permission, upload a file with the name `shell.php.` (a PHP payload as content) via the standard upload UI/API, a resumable upload, a rename of an already-uploaded file to that name, or a WebDAV `PUT`. 2. Confirm the file is accepted (no "invalid file name" rejection) and stored under the exact name `shell.php.`, verifiable via the file listing. 3. Depending on server configuration, request the file's public/serving URL and observe whether it executes as PHP (this final step is what I have not personally verified against a live deployment). 6. Recommended Fix - Change the guard so an empty parsed extension does not bypass the check. Concretely: after trimming, check whether the filename — stripped of any trailing dots — ends in a blocked extension, e.g. `$ext = strtolower(pathinfo(rtrim($fileName, '.'), PATHINFO_EXTENSION));` before the `in_array` comparison, or equivalently reject filenames containing multiple consecutive extension-like segments. - More robustly: reject filenames with a trailing dot outright (most legitimate use cases have no reason to end a filename in `.`), the same way `.htaccess`/`.user.ini`/`web.config` are already special-cased. - Consider re-validating the final, actually-stored filename against the blocklist right before the write occurs, as an additional defense-in-depth layer, rather than only validating the client-supplied name earlier in the call chain. 7. Suggested Disclosure Text > Title: Trailing-dot filename bypasses `UploadNamePolicy`'s strict-mode extension blocklist > Component: `src/FileRise/Support/UploadNamePolicy.php::isAllowedForWrite()` > Affected versions: ≤3.22.0 (current release) > Class: CWE-434 / CWE-697 > In the default "strict" upload policy, the blocked-extension check is skipped whenever `pathinfo($fileName, PATHINFO_EXTENSION)` returns an empty string, which happens for any filename ending in a literal trailing dot (e.g. `shell.php.`). The file is then accepted and written to disk with the blocked extension intact in its stored name. This affects every write path that uses this shared function: regular uploads, resumable uploads, renames, and WebDAV `PUT`. Recommend rejecting trailing-dot filenames outright, or normalizing (stripping trailing dots) before the extension comparison. --- Independently identified via source review of `src/FileRise/Support/UploadNamePolicy.php` and its callers on the current v3.22.0 release, and directly verified with a PHP 8.3 interpreter that `pathinfo()` returns an empty extension for trailing-dot filenames. Distinct from CVE-2025-62509, CVE-2026-33070/33071/33072, and GHSA-46gv/GHSA-vh5m — this is a logic gap inside the validation function itself, not a case of validation being skipped entirely on one surface. Not previously published as a CVE or GitHub Security Advisory as of this writing. End-to-end RCE impact on a live, default-configured deployment was not personally demonstrated and should be verified by the maintainer. Maintainer Assessment Thank you for the responsible disclosure and careful impact scoping. We confirmed the validation defect. `UploadNamePolicy::isAllowedForWrite()` used `pathinfo()` to inspect the final extension, and PHP returns an empty extension for a name ending in a literal dot. A filename such as `shell.php.` could therefore pass the default strict extension check. Because this shared policy is used by the regular and resumable upload paths, renames, shared uploads, and WebDAV writes, the same filename form could reach multiple write surfaces. The fix is included in FileRise v3.23.0: - Filenames ending in a dot are rejected after bounded URL decoding and whitespace trimming. - The rejection applies before mode-specific extension handling, preventing trailing-dot normalization from bypassing both the strict executable-extension list and always-blocked server configuration names. - The intentional `code_friendly` policy continues to permit code extensions when the filename itself is valid. - Ordinary filenames, including valid multi-extension names such as `archive.tar.gz`, are unchanged. - Existing stored files are not renamed or removed; the change affects only new writes and rename destinations. - Focused regressions cover literal, repeated, mixed-case, and URL-encoded trailing-dot forms. The demonstrated behavior establishes a real bypass of the configured strict filename policy, but it does not establish code execution in FileRise's supported default environment. The official Docker image denies direct HTTP access to the upload directory, and a typical end-of-string PHP handler does not execute a literal `.php.` filename. Exploitation beyond storing a policy-disallowed filename therefore depends on a separate filesystem or web-server normalization behavior and should not be described as confirmed RCE without an end-to-end demonstration on an affected configuration. Please verify the remediation against FileRise v3.23.0 before publication. We will coordinate a CVE through this GitHub security advisory after the affected and patched versions are finalized.
Severity Level
LOW(3.1)
Published Date
Aug 2, 2026
Last Modified
Aug 2, 2026
Exploitation Status
No confirmed exploitation yet
CVE Record Status
Reserved
This CVE ID is referenced in a public advisory, but the CVE Program has not published its official CVE Record yet. Full CVSS/CPE data from NVD will appear here once it does.
Root Weakness (CWE)
The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
The product compares two entities in a security-relevant context, but the comparison is incorrect.
CVSS v3.1 Base Metrics — Score 3.1
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Attack VectorNetwork
Attack ComplexityHigh
Privileges RequiredLow
User InteractionNone
ScopeUnchanged
ConfidentialityNone
IntegrityLow
AvailabilityNone

Affected & Patched Versions

Affected Versions
  • error311/FileRise ≤ 3.22.0
Patched Versions
  • error311/FileRise 3.23.0

What to do

Fix it during your normal patch cycle. No exploitation is confirmed yet.

  1. Check whether you run error311/FileRise and which version.
  2. Update to a patched version listed above, then confirm the new version.

Timeline

  • Aug 2, 2026Published
  • Aug 2, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new error311/FileRise CVEsYou are reading CVE-2026-115896. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 25, 2026 14:00 UTC