/

CVE-2026-45053

Severity:

CRITICAL RISK

(9.1)

Arbitrary File Upload in CubeCart REST API File Manager

CVE-2026-45053

Deferred

Vulnerability type

Category:

Arbitrary File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.1)

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

An authenticated arbitrary file upload vulnerability in CubeCart's REST API File Manager endpoint allows users with a files:rw API key to upload executable PHP files into web-accessible directories.

When combined with a path traversal flaw in the filepath parameter, a single API call can deploy a webshell into the document root, enabling full remote code execution under the web server's privileges.

Affected context

This issue arises in CubeCart deployments that:

  • Expose the REST API File Manager endpoint at POST /api/v1/files
  • Grant API keys the files:rw scope for file management operations
  • Serve PHP or other executable scripts from directories reachable via the File Manager (e.g., images/source/ or document root)
  • Do not enforce strict server-side validation of uploaded file types and upload paths

In these conditions, API clients can upload and place executable files where the web server will process them as code rather than static content.

Exploit preconditions

  • Attack surface: HTTP(S) REST API endpoint POST /api/v1/files
  • Required access: Valid CubeCart API credentials with files:rw permission
  • Trigger point: Uploading a file via the File Manager API and specifying a crafted filepath and PHP payload
  • Why exploitation is possible:
  • The File Manager accepts user-controlled filenames and filepaths with insufficient restrictions.
  • The server allows PHP files to be written into web-accessible locations that are executed by the PHP interpreter.
  • A path traversal weakness in filepath allows bypassing intended upload directories and writing directly into locations such as the document root.

Why this happens

The vulnerability stems from insufficient server-side validation and enforcement of file upload constraints in the File Manager endpoint.

User-controlled parameters (file content, extension, and filepath) are trusted to define where files are stored and what type of content is accepted.

This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, where the application fails to restrict or sanitize upload types and destinations, enabling attackers to introduce executable code into directories served by the application stack.

Potential impact

  • Remote code execution on the web server via uploaded PHP webshells
  • Complete compromise of the CubeCart application and associated data
  • Modification or defacement of storefront content and product data
  • Theft of customer information, orders, and potentially payment-related data depending on integration
  • Use of the compromised server as a pivot for lateral movement within the hosting environment

General mitigation guidance

Effective mitigation focuses on constraining what can be uploaded, where it can be stored, and how the server treats uploaded content:

  • Enforce strict allowlists for file extensions and MIME types on upload endpoints, rejecting executable formats (e.g., PHP, CGI, scripts).
  • Normalize and validate upload paths, preventing directory traversal and forcing all uploads into non-executable, segregated directories.
  • Configure the web server so that upload directories are not executable (e.g., disable PHP execution in image and media folders).
  • Apply principle of least privilege to API keys, granting files:rw only when strictly necessary and separating operational duties.
  • Log and monitor file upload operations, especially those that modify unusual directories or introduce atypical file types.

How teams detect issues like this

Detection generally involves reviewing both code and runtime behavior:

  • Static analysis and code review:
  • Look for upload handlers that write user-supplied file content using attacker-controlled names or paths.
  • Flag uses of file APIs where the requested path is derived from request parameters without canonicalization or path checks.
  • Check that upload logic enforces robust extension and MIME-type allowlists rather than weak or blacklist-based checks.
  • Configuration and policy checks:
  • Verify web server configurations to ensure upload directories are configured as non-executable.
  • Implement policies that restrict which API keys may use file upload endpoints and enforce rotation and revocation procedures.
  • Runtime monitoring:
  • Monitor logs for suspicious uploads (e.g., .php, .phtml, or other executable extensions) via REST API endpoints.
  • Detect anomalies such as newly created executable files in web roots or media directories.

Automated security testing tools and SAST/DAST scanners can help surface these patterns, especially when integrated into CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/cubecart/v6/security/advisories/GHSA-652f-8c88-25cx

Frequently asked

questions

Yes, it is remotely exploitable through the REST API, but only by clients that possess valid API credentials with the required file upload permissions.

An attacker needs an API key with files:rw permission or equivalent access to the File Manager endpoint. This could result from compromised credentials, overly broad key distribution, or abuse by a malicious insider.

The safest pattern is to enforce strict server-side validation and normalization of both uploaded file types and paths, ensure upload destinations are non-executable, and limit which identities can perform file uploads. Even if an attacker can upload a file, it should not be executable or placed outside a controlled media directory.

Design upload features with a deny-by-default posture: restrict extensions to a narrow allowlist, separate upload storage from executable code, sanitize and canonicalize all paths, and regularly review API permissions. Embedding these rules into coding standards, automated tests, and security reviews reduces the likelihood of regressions.

Find out what's already
exploitable in your codebase.