/

CVE-2026-35164

Severity:

HIGH RISK

(8.8)

Unrestricted File Upload in Brave CMS CKEditor Upload

CVE-2026-35164

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution by uploading and executing server-side scripts

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Brave CMS versions prior to 2.0.6 contain an unrestricted file upload flaw in the CKEditor upload functionality that fails to validate uploaded file types.

An authenticated user can upload executable PHP scripts through the ckupload endpoint and potentially achieve remote code execution on the underlying server.

Affected context

This vulnerability occurs in Brave CMS installations using the CKEditor upload functionality exposed by CkEditorController::ckupload.

The affected context is any deployment where:

  • PHP is used as the server-side runtime
  • Uploaded files are stored in a web-accessible directory or a location that the web server can execute as PHP
  • The CKEditor upload endpoint is accessible to authenticated users without additional file type restrictions

In such environments, insufficient server-side validation and trust in client-provided file metadata makes it possible to store executable content.

Exploit preconditions

  • Attack surface: HTTP(S) endpoint handling CKEditor file uploads (ckupload method).
  • Required access: Valid authenticated Brave CMS user account with permission to use the CKEditor upload feature.
  • Trigger point: Submitting a crafted POST request to the upload endpoint containing a file with PHP code and a permitted filename/extension.
  • Why exploitation is possible:
  • The upload handler relies on user-controlled input (such as filename and extension) without robust server-side validation.
  • No effective whitelist-based filtering of MIME types or extensions is enforced.
  • Uploaded files are placed in a location where the web server can interpret them as executable PHP.

Why this happens

The underlying bug is a classic unrestricted file upload problem mapped to CWE-434.

The ckupload method trusts user-supplied file attributes and does not perform strict server-side checks to ensure only safe, non-executable file types are accepted.

As a result, an attacker can upload arbitrary files including PHP scripts, which may then be executed by the server if stored under a script-executable path.

This reflects an insecure pattern where upload endpoints:

  • Lack a strict allowlist of permitted content types and extensions
  • Do not normalize or validate file names independent of user input
  • Do not separate uploaded content from executable application paths

Potential impact

  • Remote execution of arbitrary PHP code on the server.
  • Full compromise of the Brave CMS instance, including reading or modifying content and configuration.
  • Extraction of database credentials and sensitive application secrets from configuration files.
  • Lateral movement within the hosting environment, depending on server privileges.
  • Website defacement or injection of malicious content served to end users.
  • Use of the compromised server as a pivot point for further attacks inside the network.

General mitigation guidance

In general, mitigation for unrestricted file upload issues focuses on constraining what can be uploaded and how it is handled by the server:

  • Enforce a strict allowlist of permitted file extensions and MIME types, checked server-side and independent of client input.
  • Normalize and validate filenames server-side; generate server-controlled filenames instead of using user-provided names.
  • Store uploaded files outside of any directories that the web server can execute as code, serving them as static content only.
  • Configure the web server so that upload directories do not execute scripts (e.g., disable PHP execution for those paths).
  • Implement additional content checks such as validating image structure for image uploads instead of relying on extensions alone.
  • Apply least-privilege principles to the process handling uploads so that a compromise has limited blast radius.

These patterns help ensure that even if a malicious file is accepted, it cannot easily be executed by the server.

How teams detect issues like this

Detection typically combines code-level analysis with runtime monitoring:

  • Static analysis: Look for upload handlers that move files from $_FILES (or framework equivalents) without validating extension, MIME type, or content; flag controllers that write user-supplied files into web-accessible paths.
  • Code review: During manual review, pay attention to:
  • Controllers named for upload or media handling (e.g., CkEditorController, UploadController)
  • Direct calls to filesystem APIs that use user-controlled paths or filenames
  • Absence of server-side checks enforcing an allowlist of file types
  • Configuration review: Verify that upload directories are configured as non-executable in web server configuration and that execution is disabled for them.
  • Runtime monitoring: Use web server logs and WAF rules to detect suspicious uploads (e.g., .php, .phtml, .php5 files) and subsequent requests to newly uploaded files.
  • Automated tools: Static application security testing (SAST) and security linters can be configured with rules to identify generic file upload anti-patterns.

Sources

SourceLink
github.comgithub.com/Ajax30/BraveCMS-2.0/security/advisories/GHSA-2j4q-6p52-4rhw

Frequently asked

questions

Exploitation is limited to users who can authenticate to Brave CMS and access the CKEditor upload functionality, but within that scope it can be highly impactful because it may lead to remote code execution on the server.

Not necessarily. Any authenticated account with permission to use CKEditor's upload feature could potentially exploit the flaw if no further role-based restrictions are in place. The critical requirement is access to the vulnerable upload endpoint, not admin-level capabilities.

The most robust fix is to implement strict server-side validation that only permits a narrow set of safe, non-executable file types, store them in non-executable directories, and prevent user control over final file names and execution paths. Combine this with server configuration that disallows script execution in upload locations.

Treat every file upload as untrusted input: design upload features with allowlists, layered validation (extension, MIME type, and content), and non-executable storage by default. Incorporate security reviews for all file handling code, use automated checks to flag risky upload patterns, and maintain hardening rules in web server and framework configuration for upload directories.

Find out what's already
exploitable in your codebase.