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
filePathandcontentarguments bycreate_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.

