/

CVE-2023-54422

Severity:

CRITICAL RISK

(9.8)

Unrestricted File Upload (CWE-434) in iDocView Endpoint

CVE-2023-54422

Received

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Arbitrary file write and potential 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

iDocView has an unrestricted file upload issue in the /html/2word endpoint, where an unauthenticated request can cause linked resources to be written to an unsanitized path. If the endpoint is exposed and a malicious resource is saved with a .jsp extension, this may enable remote code execution.

Affected context

The issue affects iDocView versions before 13.10.1_20231115. It occurs in the /html/2word endpoint, which processes a supplied url parameter to retrieve linked resources; the risk depends on the endpoint being reachable and accepting paths and file types without adequate safeguards.

Exploit preconditions

  • Attack surface: The /html/2word endpoint must be reachable over the network.
  • Required access: The described attack does not require authentication.
  • Trigger point: A GET request supplies a url parameter that causes the endpoint to retrieve and write a resource.
  • Why exploitation is possible: The destination path is not adequately sanitized, and .jsp files are not blocked, potentially allowing an attacker to place executable content where the application can run it.

Why this happens

The application retrieves a resource and writes it to a file without sufficiently restricting the destination path or permitted file types. This maps to CWE-434: Unrestricted Upload of File with Dangerous Type: uploaded or fetched content can be stored with a dangerous extension and may be interpreted as executable by the server.

Potential impact

  • An attacker may write arbitrary files to locations accessible to the application.
  • A malicious .jsp file could enable remote code execution if the server executes it.
  • Application data or availability could be compromised.
  • A compromised application process could be used to affect other accessible resources, depending on its privileges and environment.

General mitigation guidance

Common defensive patterns for file retrieval and upload endpoints include:

  • Allowing only explicitly approved resource types and extensions.
  • Generating server-controlled filenames and restricting writes to a dedicated, non-executable storage location.
  • Canonicalizing and validating destination paths, and rejecting paths outside the intended directory.
  • Treating supplied URLs and retrieved content as untrusted; where feasible, limiting outbound retrieval to approved hosts.
  • Applying least privilege to the application process and disabling script execution in upload or temporary storage areas.

How teams detect issues like this

Detection approaches may include:

  • Reviewing code for URL-fetching or file-writing handlers that accept client-controlled paths or filenames.
  • Using static analysis to flag unrestricted file upload patterns, unsafe path construction, and executable extensions in writable locations.
  • Monitoring application and web-server logs for unexpected requests to /html/2word and unusual url parameter values.
  • Auditing writable directories for unexpected .jsp files and enforcing policies that prevent executable content from being stored in upload areas.

Sources

SourceLink
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/idoc/idocview-2word-fileupload.yaml
secrss.comsecrss.com/articles/60990
vulncheck.comvulncheck.com/advisories/idocview-13.10-1-20231115-unrestricted-file-upload-rce-via-html-2word
vulncheck.comvulncheck.com/advisories/idocview-before-13.10-1-20231115-unrestricted-file-upload-rce-via-html-2word

Frequently asked

questions

Yes. The described issue can be triggered through a network request if the /html/2word endpoint is reachable.

The vulnerability description indicates that authentication is not required.

Restrict accepted content types, use server-generated filenames, validate canonical destination paths, and store retrieved files outside executable locations.

Treat client-supplied URLs and file content as untrusted, enforce allowlists and storage policies, and monitor file-writing endpoints for unexpected activity.

Find out what's already
exploitable in your codebase.