/

CVE-2026-81491

Severity:

HIGH RISK

(7.3)

Path Traversal (CWE-22) in with-context-mcp Handlers

CVE-2026-81491

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Access or Modification

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

A path traversal flaw in with-context-mcp affects note ingestion, teleportation, synchronization, and project-folder handling. If a remotely reachable function accepts attacker-controlled path values without adequate containment checks, an attacker may access or modify files outside the intended project directory.

Affected context

The vulnerability occurs in the note and project-folder functions implemented in src/index.ts. It may affect deployments using with-context-mcp versions up to 3.0.7 when these functions process externally influenced file or directory paths and the service is reachable by an attacker. The practical impact depends on the operating-system permissions of the service account and whether the affected operations permit reading, writing, or synchronizing files.

Exploit preconditions

  • Attack surface: Remotely reachable MCP functions for note or project-folder operations
  • Required access: Access to invoke the affected service functions; authentication requirements depend on deployment configuration
  • Trigger point: Processing a path supplied to ingest_notes, teleport_notes, sync_notes, or project_folder
  • Why exploitation is possible: Path input may be used without reliably constraining resolution to an approved project directory

Why this happens

The underlying bug is insufficient validation and containment of attacker-influenced filesystem paths. When an application combines a trusted base directory with an untrusted path without canonicalization and boundary checks, traversal elements can cause resolution outside the intended location. This behavior maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal.

Potential impact

  • An attacker may read files outside the intended project directory
  • An attacker could modify or overwrite files if the affected operation permits writing
  • Sensitive configuration, source code, or credential material may be exposed
  • The service account or connected project data may be compromised
  • File manipulation could support further compromise of the host or application

General mitigation guidance

Mitigation generally focuses on enforcing a strict filesystem trust boundary for every path-handling operation. Common defensive patterns include resolving paths canonically before use, verifying that the resolved result remains within an approved directory, rejecting ambiguous or unexpected path formats, and preferring opaque file identifiers over client-supplied paths. File operations can be separated by purpose, with read and write permissions minimized and service accounts restricted from sensitive locations. Secure-by-default configurations should limit exposed functions and avoid allowing arbitrary project roots or filesystem locations to be selected by remote callers.

How teams detect issues like this

Detection can include static-analysis rules for path concatenation or filesystem APIs that consume request-derived values without canonicalization and boundary validation. Code review should examine every affected function for trusted-base enforcement, symlink handling, platform-specific path behavior, and consistent validation across read, write, copy, and synchronization paths. Runtime controls can log rejected paths, unexpected directory escapes, and access to files outside approved roots; automated security review tools may help identify these patterns during development.

Sources

SourceLink
github.comgithub.com/boxpositron/with-context-mcp/issues/2
vuldb.comvuldb.com/cve/CVE-2026-81491
vuldb.comvuldb.com/submit/887138
vuldb.comvuldb.com/vuln/395981
vuldb.comvuldb.com/vuln/395981/cti

Frequently asked

questions

It may be remotely exploitable when the affected MCP functions are network

reachable and an attacker can invoke them with controlled path values. Actual

exposure depends on authentication, authorization, and service deployment

controls.

The attacker generally needs permission to reach and call one of the affected

functions. The resulting access is also limited or expanded by the privileges

of the service account and the directories available to it.

Resolve supplied paths against an explicitly approved root and verify the

canonical result remains within that root before performing any filesystem

operation. Reject invalid, ambiguous, or out-of-scope paths by default.

Minimize filesystem privileges, use application-level identifiers instead of

raw paths, apply consistent validation to every file operation, and test for

traversal and symlink-escape conditions in code review and automated security

checks.

Find out what's already
exploitable in your codebase.