/

CVE-2018-25443

Severity:

CRITICAL RISK

(9.8)

Unrestricted File Upload (CWE-434) in Baidu UEditor

CVE-2018-25443

Received

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.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

Baidu UEditor versions 1.4.0 through 1.4.3.3 have an unrestricted file upload vulnerability in the catchimage action. An unauthenticated attacker who can reach the endpoint may be able to upload an executable ASP.NET file, potentially enabling remote code execution.

Affected context

The issue is reported in Baidu UEditor 1.4.0 through 1.4.3.3, in the catchimage action at /ueditor/net/controller.ashx. The action reportedly validates the Content-Type header without adequately ensuring that the resulting file has a safe extension. A crafted source[] URL may preserve a malicious extension, creating risk when the uploaded file is stored in a location where executable ASP.NET files can run.

Exploit preconditions

  • Attack surface: The UEditor catchimage action must be reachable.
  • Required access: The reported issue does not require authentication.
  • Trigger point: The action processes a supplied source[] URL and saves the retrieved file.
  • Why exploitation is possible: Validation based only on the Content-Type header may not prevent an executable extension from being retained. Remote code execution depends on the file being written to a location where ASP.NET execution is enabled.

Why this happens

The underlying bug is insufficient validation of uploaded or remotely retrieved files, mapping to CWE-434: Unrestricted Upload of File with Dangerous Type. Trusting a request's Content-Type header without independently validating the file name, extension, content, and storage context can allow a dangerous file type to pass checks.

Potential impact

  • An attacker may be able to store an executable file on the server.
  • If the file is accessible and executable, the attacker could run code in the server's application context.
  • Successful code execution could lead to compromise of application data or services, depending on the server's permissions and configuration.

General mitigation guidance

Defensive approaches generally combine strict file validation with safe storage and least privilege:

  • Prefer allowlists of permitted file types and derive file type from content rather than trusting client-supplied headers.
  • Normalize and validate file names and extensions, and generate server-controlled storage names.
  • Store uploaded files outside executable web roots, or serve them through a handler that does not execute them.
  • Limit the application account's write permissions and disable execution in upload locations where feasible.
  • Treat remote source URLs as untrusted input and apply validation before retrieving or storing their contents.

How teams detect issues like this

  • Use static analysis and code review to find upload handlers that rely on Content-Type or filename extensions as their sole validation.
  • Review whether uploaded files are stored under web-accessible paths and whether those paths permit server-side execution.
  • Monitor upload handling for unexpected extensions, mismatches between declared content types and file contents, and unusual requests to the catchimage action.
  • Apply policy checks requiring server-side file type validation, generated storage names, and non-executable upload locations.

Sources

SourceLink
github.comgithub.com/fex-team/ueditor/blob/v1.4.3.3/net/App_Code/CrawlerHandler.cs
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/other/ueditor-file-upload.yaml
web.archive.orgweb.archive.org/web/20190612114715/https://www.freebuf.com/vuls/181814.html
vulncheck.comvulncheck.com/advisories/baidu-ueditor-1.4.0-1.4.3.3-unrestricted-file-upload-via-controller-ashx

Frequently asked

questions

The reported endpoint can be reached over the network, and exploitation is described as unauthenticated. Remote code execution depends on the uploaded file being stored where ASP.NET execution is enabled.

The report describes no authentication requirement. The affected action must be reachable, and its file handling must allow the uploaded content to be stored in an exploitable location.

Validate file content and type using server-side rules, use server-generated names, and keep uploaded files in non-executable storage.

Avoid trusting client-supplied headers or extensions, enforce upload policies in code and review, and restrict write permissions and execution in upload directories.

Find out what's already
exploitable in your codebase.