/

CVE-2026-94044

Severity:

HIGH RISK

(7.3)

Path Traversal (CWE-22) in 03-lovepreetSingh MCP API

CVE-2026-94044

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Write

Severity:

HIGH RISK

(7.3)

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

CVE-2026-94044 is a high-severity path traversal vulnerability in the create_file function of the 03-lovepreetSingh MCP API route. A remote attacker may manipulate the filePath argument to write content outside the intended directory when the endpoint is reachable and lacks effective path containment controls.

Affected context

The vulnerability occurs in the file-creation endpoint at app/api/mcp/route.ts, specifically in the create_file function. It may affect deployments that expose this route to remote users and allow attacker-controlled values for filePath without reliably constraining the resolved destination to an approved directory. The practical impact depends on process permissions, filesystem layout, and deployment configuration.

Exploit preconditions

  • Attack surface: Remotely reachable MCP API file-creation route
  • Required access: Access sufficient to invoke the endpoint; authentication requirements depend on deployment controls
  • Trigger point: Processing of attacker-influenced filePath and content arguments by create_file
  • Why exploitation is possible: The requested path may be resolved outside the intended storage location when traversal sequences or equivalent path representations are not rejected and canonical containment is not enforced

Why this happens

The underlying bug is improper limitation of a pathname used for file creation. When application input is combined with a trusted base directory without canonicalizing the result and verifying that it remains within an allowed boundary, path components can redirect file operations to unintended locations. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal.

Potential impact

  • An attacker may write or overwrite files accessible to the application process
  • Application configuration or source files could be modified
  • Stored content may be placed in unintended directories
  • The service could experience integrity loss or denial of service
  • In some environments, file placement could contribute to further compromise

General mitigation guidance

Mitigation generally focuses on reducing trust in client-supplied paths and enforcing a clear filesystem boundary.

Common defensive patterns include:

  • Resolve paths against a fixed, approved directory and verify canonical containment before writing
  • Prefer server-generated identifiers or controlled filenames over arbitrary client-provided paths
  • Reject traversal components, absolute paths, alternate separators, and encoded path representations
  • Restrict writable locations and apply least-privilege filesystem permissions to the service process
  • Validate content size and file type where appropriate, and avoid overwriting existing files by default
  • Apply authentication, authorization, and rate limits to file-management operations

How teams detect issues like this

Organizations commonly detect path traversal risks through:

  • Static analysis rules for filesystem APIs that receive request parameters
  • Code review checks for path joining without canonicalization and containment verification
  • Tests using relative traversal, absolute, encoded, and platform-specific path forms
  • Runtime monitoring for writes outside approved directories or unexpected changes to configuration and source files
  • API policies that restrict file operations to allowlisted directories and controlled naming schemes

Automated security scanning and code review tools may help identify dangerous data flows from HTTP or MCP arguments into filesystem operations.

Sources

SourceLink
github.comgithub.com/03-lovepreetSingh/MCP/
github.comgithub.com/03-lovepreetSingh/MCP/issues/3
vuldb.comvuldb.com/cve/CVE-2026-94044
vuldb.comvuldb.com/submit/949284
vuldb.comvuldb.com/vuln/407973
vuldb.comvuldb.com/vuln/407973/cti

Frequently asked

questions

Potentially. Exploitation may be possible when the MCP API route is remotely reachable and an attacker can invoke the file-creation operation.

That depends on the deployment. The essential requirement is authorization to reach and use the affected endpoint; weak or missing access controls increase exposure.

Treat the path as untrusted, use a fixed writable directory, canonicalize the resulting path, and verify that it remains within the approved boundary before performing any write.

Use server-controlled filenames where possible, enforce allowlisted directories, apply least-privilege filesystem permissions, and include traversal-focused tests and static analysis in the development process.

Find out what's already
exploitable in your codebase.