/

CVE-2026-27483

Severity:

HIGH RISK

(8.8)

Path Traversal in File Upload in MindsDB files

CVE-2026-27483

Analyzed

Vulnerability type

Category:

Path Traversal in File Upload

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Remote Code Execution

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

MindsDB's /api/files upload endpoint previously allowed authenticated users to supply crafted filenames containing path traversal sequences, causing files to be written outside the intended directory.

By writing arbitrary content to sensitive locations on the server, an attacker could chain this into remote command execution under certain deployment configurations.

Affected context

This vulnerability affects MindsDB deployments exposing the /api/files endpoint where:

  • Multipart file uploads are accepted from authenticated users.
  • The server-side upload logic writes files based directly on user-supplied filenames.
  • Filenames are not normalized, sanitized, or constrained to a dedicated storage directory before the write occurs.

Environments that execute or interpret files from writable paths (e.g., application directories, script folders, or configuration locations) are at higher risk of remote code execution.

Exploit preconditions

  • Attack surface: HTTP API endpoint at /api/files handling multipart file uploads.
  • Required access: Valid authenticated access to the MindsDB instance with permission to use the upload API.
  • Trigger point: Submitting a crafted multipart/form-data request where the filename field includes directory traversal sequences (e.g., ../), causing the server to resolve the path outside the intended upload directory.
  • Why exploitation is possible: The upload implementation performs the file write before applying clear_filename or save_file safeguards, and does not normalize or validate the path. As a result, the raw user-supplied filename is treated as a trusted filesystem path, enabling arbitrary file writes in locations controlled by the server process.

Why this happens

The core issue is a classic path traversal flaw in file upload handling, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The upload handler directly uses a client-provided filename to construct the target path and writes the file before any cleaning or restriction is applied. Without normalization, canonicalization, and enforcement of a fixed upload root, ../ sequences and absolute or relative paths can escape the intended directory.

This insecure pattern conflates user-controlled data with trusted filesystem locations, and in environments where written files can later be executed or loaded as code or configuration, it naturally escalates into remote code execution.

Potential impact

  • Arbitrary file creation or overwriting within directories writable by the MindsDB server process.
  • Modification of application or framework files leading to code execution.
  • Tampering with configuration, environment, or startup scripts to gain persistent access.
  • Planting web-accessible or service-loaded backdoors, enabling follow-on attacks.
  • Disruption of service availability by corrupting critical files or data.

General mitigation guidance

Effective mitigation focuses on strictly separating user-controlled filenames from server filesystem paths and hardening the upload pipeline:

  • Constrain uploads to a dedicated, non-executable directory and construct server-side filenames independently of user input (e.g., UUIDs or safe, whitelisted names).
  • Normalize and canonicalize any path components and explicitly reject inputs that resolve outside the intended upload root.
  • Apply robust filename sanitization that removes directory separators, dot-dot sequences, and control characters rather than attempting partial filtering.
  • Treat uploaded content as untrusted: avoid executing, interpreting, or dynamically importing files from upload locations.
  • Apply least-privilege to the MindsDB service account so it can write only where necessary and cannot modify executable or configuration paths.
  • Use defense-in-depth controls such as filesystem permissions, containerization, and mount options (e.g., noexec where applicable) to reduce the blast radius of any upload-related issues.

How teams detect issues like this

Detection efforts can combine code-level and operational monitoring:

  • Static analysis rules that flag uses of user-supplied filenames in file operations (open, write, save, etc.) without prior normalization to a fixed base directory.
  • Code review checklists that explicitly call out file upload and path handling, ensuring all files are stored under a controlled root and names are generated server-side.
  • Security testing (including fuzzing and DAST) that attempts ../ and similar traversal patterns in upload filenames to confirm proper rejection.
  • Runtime audit logging of upload requests, including normalized target paths, and alerting on attempts to write outside the designated upload directory.
  • Host-based monitoring for unexpected file creation or modification in application, configuration, or binary directories by the MindsDB service account.

Automated SAST/IAST tools can assist by highlighting dangerous path concatenation patterns and unvalidated filename usage in upload handlers.

Sources

SourceLink
github.comgithub.com/mindsdb/mindsdb/commit/87a44bdb2b97f963e18f10a068e1a1e2690505ef
github.comgithub.com/mindsdb/mindsdb/releases/tag/v25.9.1.1
github.comgithub.com/mindsdb/mindsdb/security/advisories/GHSA-4894-xqv6-vrfq

Frequently asked

questions

Yes, it is exploitable over the network via the /api/files HTTP endpoint, but it requires authenticated access to the MindsDB instance and the ability to perform file uploads.

The attacker must be an authenticated user with permission to call the upload API. They do not need shell access to the server, but they do need the ability to submit crafted multipart upload requests.

The safest pattern is to ignore client-provided paths for storage and instead generate server-side filenames under a fixed, non-executable upload directory. Any user-supplied filename should be treated as metadata only, and all filesystem paths must be normalized and validated against a strict allowlist of directories.

Establish a standard file-handling policy: always resolve file operations relative to a predefined root, avoid concatenating raw user input into paths, enforce strong filename sanitization, and verify these rules via code review and automated security testing. Combined with restrictive filesystem permissions and least-privilege service accounts, this significantly reduces the risk of path traversal leading to code execution.

Find out what's already
exploitable in your codebase.