Severity:

HIGH RISK

(7.3)

Path Traversal in elinsky execution-system-mcp add_action

CVE-2026-7319

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access

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 vulnerability in elinsky execution-system-mcp 0.1.0 allows attackers to manipulate the context argument processed by _get_context_file_path in server.py to access unintended filesystem locations.

When reachable over a network, this flaw can let a remote attacker read or potentially influence files outside the intended context directory, depending on how the resolved path is used by the add_action tool.

Affected context

The vulnerability appears when the add_action tool in execution-system-mcp uses the _get_context_file_path function to construct file paths from a user-controllable context parameter.

If the application accepts context values from remote requests and concatenates them into filesystem paths without proper normalization or restriction to an allowed base directory, an attacker-controlled path can escape the intended directory structure.

The exact impact depends on how the resolved path is used (e.g., reading, writing, or executing files) and what permissions the service account has on the host system.

Exploit preconditions

  • Attack surface: Network-exposed interface that accepts or forwards the context parameter to the add_action tool.
  • Required access: Ability to send crafted requests to the vulnerable service endpoint (no local shell access required).
  • Trigger point: Invocation of _get_context_file_path with unvalidated context data that includes traversal sequences (e.g., ../) or absolute paths.
  • Why exploitation is possible: The implementation likely joins or formats user-supplied path fragments into a filesystem path without enforcing that the final resolved path stays within a designated, trusted base directory.

Why this happens

This issue stems from constructing filesystem paths using untrusted input without proper validation or canonicalization, a classic example of CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The _get_context_file_path function in server.py is reported to accept a context argument and use it directly in path building logic.

Without checks to remove traversal sequences, reject absolute paths, or verify that the normalized path is within a specific root directory, attackers can cause the code to operate on files outside the intended context area.

The bug class is an insecure pattern where path-based authorization is assumed rather than enforced, allowing untrusted data to influence which resources are accessed on the filesystem.

Potential impact

  • Access to files outside the intended context directory that the service account can read.
  • Potential exposure of configuration files, API keys, or other sensitive data stored on the server.
  • Overwriting or creating files in unintended locations if the resulting path is used for write operations.
  • Indirect code or script execution if the application later loads or executes data from attacker-controlled file locations.
  • Facilitation of further attacks, such as privilege escalation or lateral movement, when combined with other weaknesses.

General mitigation guidance

Effective mitigation focuses on tightly controlling how file paths are derived from external input and enforcing strict directory boundaries:

  • Restrict all context-based file access to a fixed, application-defined root directory, and verify that the resolved path never escapes this root.
  • Normalize and canonicalize paths before use, rejecting values that contain traversal patterns (e.g., .., mixed separators) or that resolve outside the allowed base directory.
  • Prefer high-level file access helpers that accept a logical identifier instead of raw filesystem paths, and map those identifiers to known-safe paths server-side.
  • Apply least-privilege principles to the service account so it only has read/write permissions to the minimal set of directories required.
  • Avoid echoing back raw filesystem paths or error messages that might help attackers refine traversal payloads.

How teams detect issues like this

Detection can combine code-centric and operational approaches:

  • Static analysis: Flag usages where user-controlled variables (e.g., request parameters, JSON fields named context) are concatenated or formatted into OS paths (e.g., os.path.join, Path(...)) without subsequent checks against an allowed base directory.
  • Code review: Look for helper functions like _get_context_file_path and assess whether they enforce a root directory, perform canonicalization, and reject suspicious path constructs. Pay attention to any logic that trusts client-provided directory names or relative paths.
  • Policy enforcement: Introduce secure coding guidelines that forbid direct use of raw user input in path construction and require a central path-resolution utility that implements all necessary checks.
  • Runtime monitoring: Configure file access monitoring or audit logs to alert on unexpected file access patterns (e.g., access to configuration directories or parent directories from the service process).

Sources

SourceLink
github.comgithub.com/elinsky/execution-system-mcp/
github.comgithub.com/elinsky/execution-system-mcp/issues/1
vuldb.comvuldb.com/submit/803085
vuldb.comvuldb.com/vuln/359972
vuldb.comvuldb.com/vuln/359972/cti

Frequently asked

questions

Yes. The issue can be triggered remotely if an attacker can send requests that control the context value processed by the add_action tool and _get_context_file_path.

The attacker typically needs network access to the exposed service endpoint that uses the vulnerable function. No local filesystem access is required; the weakness is in how the server handles attacker-supplied input.

Introduce a robust path-resolution routine that: (1) anchors all context-based paths under a predefined base directory, (2) normalizes the full path, and (3) rejects any input that causes the resolved path to fall outside that base. Use this routine consistently wherever context paths are derived.

Treat all path fragments from clients as untrusted, avoid directly mapping user input to filesystem paths, centralize file-access logic behind a vetted API, and enforce secure coding policies plus static checks that highlight unvalidated path usage during code review and CI.

Find out what's already
exploitable in your codebase.