Summary
A path traversal vulnerability in Knowns MCP tool arguments allows attackers to use crafted filesystem paths to escape the intended project directory. Depending on the server process permissions, this may expose, create, overwrite, or delete Markdown files outside the project workspace.
Affected context
The vulnerability affects Knowns deployments that process MCP tool arguments containing filesystem paths without adequately validating that the resolved paths remain within the permitted project directory. It becomes risky when an attacker can invoke the relevant MCP tools and the server process has access to files beyond the intended workspace.
Exploit preconditions
- Attack surface: MCP tools that accept filesystem path arguments
- Required access: Ability to invoke the affected tools through an exposed or trusted MCP interface
- Trigger point: Processing a path argument containing directory traversal sequences
- Why exploitation is possible: The application does not reliably canonicalize and constrain requested paths to the authorized project directory before performing filesystem operations
Why this happens
The underlying bug is insufficient filesystem path validation. User-controlled path arguments are accepted without consistently resolving them to canonical paths and verifying that the result remains within an approved directory boundary.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The insecure pattern occurs when relative path components or equivalent path representations are trusted during file reads, creation, replacement, or deletion.
Potential impact
- Attackers may read Markdown files outside the intended project directory
- Attackers could create or overwrite files accessible to the server process
- Attackers may delete project or adjacent files
- Sensitive documentation or operational content could be disclosed
- File integrity and application behavior could be disrupted
General mitigation guidance
Mitigation generally focuses on treating tool-supplied paths as untrusted and enforcing a strict filesystem boundary.
Common defensive patterns include:
- Resolve paths canonically before authorization checks
- Require the resolved path to remain beneath an explicitly permitted project root
- Reject traversal components, ambiguous path forms, and unexpected path schemes
- Use secure-by-default APIs that operate only within an approved directory
- Apply separate allowlists for readable, writable, and deletable paths
- Run the server process with the least filesystem privileges necessary
- Prevent access to sensitive directories through operating-system permissions and sandboxing
How teams detect issues like this
Organizations can detect path traversal risks through:
- Static analysis rules for filesystem APIs receiving user-controlled path arguments
- Code review checks requiring canonicalization before authorization
- Tests covering relative traversal, absolute paths, symlink resolution, and alternate path representations
- Runtime monitoring for file operations outside approved project roots
- Policy enforcement that restricts MCP tool arguments to declared workspace boundaries
- Automated security review tools that flag missing path containment checks

