CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-J7H9-2JH7-G967

GHSA-j7h9-2jh7-g967: Path Policy Bypass and Timing Side-Channel in mcp-ssh-tool

Alon Barad
Alon Barad
Software Engineer

May 8, 2026·6 min read·32 visits

Executive Summary (TL;DR)

mcp-ssh-tool <= 2.1.0 suffers from path traversal and policy bypass due to improper prefix checking, alongside an authentication timing side-channel. Upgrading to 2.1.1 resolves both issues.

The mcp-ssh-tool npm package prior to version 2.1.1 contains two significant security flaws: an incomplete path policy enforcement mechanism that permits directory traversal and local path bypasses (CWE-22), and an observable timing differential in bearer token authentication (CWE-208).

Vulnerability Overview

The mcp-ssh-tool package functions as a production-grade Model Context Protocol (MCP) SSH automation server. It facilitates secure remote command execution, file transfers, and tunnel operations. The server relies on an HTTP transport layer secured by bearer token authentication and utilizes a localized policy engine to restrict file system access.

Versions of the software prior to 2.1.1 exhibit two distinct vulnerability classes. The first flaw involves incomplete path policy enforcement, categorized under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The second flaw is an observable timing differential, categorized under CWE-208, within the HTTP bearer authentication mechanism.

These vulnerabilities allow an unauthenticated or unauthorized remote attacker to subvert intended security controls. The path traversal flaw permits access to restricted file system locations, while the timing side-channel facilitates the extraction of the authentication token. Both vectors independently compromise the integrity and confidentiality boundaries of the MCP server.

Root Cause Analysis

The path policy bypass originates from a flaw in how the server evaluates restricted directory prefixes. The authorization mechanism utilizes a deny-prefix check to block access to specific file system hierarchies. The implementation performs a raw string prefix comparison without verifying directory segment boundaries.

If an administrator configures a denial rule for the /etc directory, the engine verifies if the requested path starts with the string /etc. An attacker supplying a path such as /etc-secrets bypasses the restriction because, while it shares the denied string prefix, it represents a distinct directory entry entirely outside the denied hierarchy.

Additionally, the server fails to enforce path canonicalization prior to policy evaluation. When an application accepts file paths containing traversal sequences (..) without resolving them to their absolute form, the string-based policy check only evaluates the literal input. An attacker can supply a permitted base directory followed by traversal sequences to navigate into restricted areas.

The second vulnerability stems from the implementation of the bearer token validation logic. The server uses a standard string equality operator (e.g., ===) to compare the incoming token against the expected secret. Standard string comparison functions return false immediately upon encountering the first mismatched character. This early-exit behavior creates a measurable difference in processing time depending on how many characters match the expected string, forming a timing side-channel.

Code Analysis

While exact source code diffs are not provided in the advisory, the vulnerability description outlines standard anti-patterns in Node.js applications. The vulnerable path authorization likely relied on the String.prototype.startsWith() method without enforcing a trailing directory separator.

// Vulnerable Implementation Example
function isDenied(targetPath, deniedPrefix) {
  // Flaw 1: No canonicalization of targetPath
  // Flaw 2: Missing segment boundary check
  return targetPath.startsWith(deniedPrefix);
}

The patched implementation must perform path resolution using native libraries such as path.resolve() or path.normalize() to eliminate traversal sequences before comparison. It must also ensure the prefix check operates on distinct path segments rather than raw substrings.

// Patched Implementation Example
const path = require('path');
 
function isDenied(targetPath, deniedPrefix) {
  const resolvedTarget = path.resolve(targetPath);
  const resolvedPrefix = path.resolve(deniedPrefix);
  
  // Ensure exact match or directory boundary
  return resolvedTarget === resolvedPrefix || resolvedTarget.startsWith(resolvedPrefix + path.sep);
}

For the timing side-channel, the vulnerable code utilized standard equality operators for cryptographic material. The patch requires replacing the standard comparison with a constant-time comparison function, which processes the entire length of the buffers regardless of where a mismatch occurs.

// Vulnerable Auth Implementation
if (providedToken === expectedToken) { /* ... */ }
 
// Patched Auth Implementation
const crypto = require('crypto');
if (crypto.timingSafeEqual(Buffer.from(providedToken), Buffer.from(expectedToken))) { /* ... */ }

Exploitation Methodology

Exploiting the path policy bypass requires an attacker to identify the target paths explicitly denied by the server configuration. The attacker constructs a file transfer request specifying a source or destination path that either appends a suffix to the denied directory name (e.g., /var/log-backup instead of /var/log) or utilizes unresolved traversal sequences (e.g., /tmp/../etc/passwd).

The server receives the malicious path, evaluates it against the naive startsWith filter, and permits the operation. The underlying file system API then processes the traversal sequences natively, allowing the attacker to read or write files outside the intended operational scope.

Exploiting the observable timing differential requires a high-resolution timing attack against the authentication endpoint. The attacker iteratively sends HTTP requests containing a guessed bearer token. The attacker measures the time elapsed between sending the request and receiving the 401 Unauthorized response.

By systematically varying the token character by character, the attacker identifies the correct character at each position by observing a statistically significant increase in response latency. This process is repeated until the entire token is recovered. Network jitter complicates this attack, necessitating hundreds or thousands of requests per character to achieve statistical confidence.

Impact Assessment

The CVSS v4.0 vector (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N) assigns a base score of 8.7, indicating high severity. The primary designated impact is to Vulnerability Integrity (VI:H), reflecting the path traversal's ability to arbitrarily write files to unauthorized file system locations via the ingress file transfer functionality.

Depending on the specific operating system and server privileges, arbitrary file write capabilities often cascade into Remote Code Execution (RCE). An attacker can overwrite SSH authorized keys, place malicious binaries in system paths, or manipulate configuration files used by the mcp-ssh-tool server.

Successful extraction of the bearer token via the timing side-channel attack grants the attacker full authentication. Once authenticated, the attacker inherits all privileges associated with the MCP server, enabling them to execute remote commands, establish tunnels, and transfer files without relying on the path bypass vulnerability.

Remediation and Mitigation

The primary remediation for both vulnerabilities is updating the mcp-ssh-tool package to version 2.1.1 or later. The update introduces canonicalization for file paths, strict segment boundary enforcement for deny-prefix rules, and constant-time comparison for bearer token authentication.

Administrators should execute npm install -g mcp-ssh-tool@latest to apply the patch across global installations. Restart the service after the installation completes to ensure the new runtime logic takes effect.

If immediate patching is unfeasible, administrators must enforce network-level mitigations. Bind the HTTP transport exclusively to the loopback interface (127.0.0.1) to prevent external access. Facilitate remote access only through authenticated SSH tunnels or internal zero-trust network architectures.

Additionally, review local filesystem policy configurations. Ensure that denied directories do not share string prefixes with sensitive but identically prefixed siblings. Monitor server logs closely for 401 Unauthorized errors generated in rapid succession, as this indicates an active timing attack against the authentication module.

Official Patches

oaslanankaPackage Repository

Technical Appendix

CVSS Score
8.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Affected Systems

mcp-ssh-tool npm package

Affected Versions Detail

Product
Affected Versions
Fixed Version
mcp-ssh-tool
oaslananka
<= 2.1.02.1.1
AttributeDetail
Vulnerability IDsGHSA-j7h9-2jh7-g967
CVSS v4.0 Base Score8.7 (High)
Primary CWEsCWE-22 (Path Traversal), CWE-208 (Observable Timing Differential)
Attack VectorNetwork
Privileges RequiredNone
Exploit StatusNo public PoC identified
Affected Versions<= 2.1.0
Fixed Version2.1.1

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1592Gather Victim Host Information
Reconnaissance
T1105Ingress Tool Transfer
Command and Control
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Vulnerability Timeline

Vulnerability details published by GitHub (GHSA-j7h9-2jh7-g967).
2026-05-07
Advisory record updated in the OSV database.
2026-05-07
Version 2.1.1 released on npm to address the issues.
2026-05-07

References & Sources

  • [1]GitHub Advisory: GHSA-j7h9-2jh7-g967
  • [2]OSV Record
  • [3]Security Advisory (GitHub Source)
  • [4]NPM Registry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•40 minutes ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
1 views•11 min read
•about 2 hours ago•CVE-2026-129296
6.5

CVE-2026-129296: Path Traversal in SpamScope mail-parser Attachment Extraction

SpamScope mail-parser versions 3.8.0 prior to 4.6.0 contain a path traversal vulnerability (CWE-22) within the write_attachments() and write_sample() functions. The library passes untrusted attachment filenames directly into os.path.join() without stripping directory components, validating path containment, or verifying symbolic links. An attacker can send a crafted email containing relative path traversal sequences or absolute filesystem paths in the Content-Disposition header to write or overwrite arbitrary files accessible to the parsing process.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 3 hours ago•CVE-2026-129295
7.5

CVE-2026-129295: Polynomial Regular Expression Denial of Service (ReDoS) in SpamScope mail-parser

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SpamScope mail-parser versions 4.2.0 prior to 4.6.1. Two separate regular expressions evaluated during standard email header parsing exhibit quadratic to cubic backtracking complexity when processing headers padded with whitespace or angle brackets. An unauthenticated remote attacker can exploit this flaw by sending a small, RFC-compliant email message, causing parsing worker threads or processes to stall at 100% CPU utilization for extended periods.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 4 hours ago•CVE-2026-129297
7.5

CVE-2026-129297: Sender IP Address Spoofing in SpamScope mail-parser

CVE-2026-129297 is an origin validation vulnerability (CWE-345) in the Python library mail-parser prior to version 4.6.2. The MailParser.get_server_ipaddress() method fails to properly isolate MTA-recorded client IP addresses from sender-controlled text within email Received headers. Due to naive substring delimiter matching, appearance-based regular expression scanning, and fail-open header traversal, remote attackers can spoof their originating IP address to bypass email security controls, blocklists, and anti-spam attribution.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 5 hours ago•CVE-2026-129299
6.5

CVE-2026-129299: Uncaught Exceptions and Silent Header Loss via Reflective Attribute Dispatch in SpamScope mail-parser

CVE-2026-129299 (GHSA-24mq-4vc6-2prf) is a parsing and serialization flaw in SpamScope mail-parser prior to version 4.6.2. The library uses reflective Python attribute resolution (getattr) over untrusted email header names and applies caller convenience transformations (such as underscore-to-hyphen folding and _json/_raw suffix stripping) directly to wire headers. An unauthenticated remote attacker can send crafted emails that trigger uncaught TypeError exceptions during JSON serialization or cause security-relevant headers and body content to be silently dropped without setting defect indicators.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 6 hours ago•CVE-2026-129236
7.2

CVE-2026-129236: Command-Line Argument Injection in Kubeshark MCP Server

CVE-2026-129236 is a command-line argument injection vulnerability (CWE-88) in Kubeshark, an eBPF-based network observability tool for Kubernetes. Located within the Model Context Protocol (MCP) server implementation in cmd/mcpRunner.go, the flaw occurs when handling the start_kubeshark tool request. When the MCP server runs with the --allow-destructive flag, the callStartKubeshark function appends the caller-supplied pod_regex parameter directly to the kubeshark tap argument slice without an end-of-options (--) delimiter. Because Kubeshark uses the Cobra and pflag libraries for command-line parsing, any pod_regex value prefixed with a hyphen is interpreted as a CLI flag rather than a positional regular expression. An attacker capable of influencing MCP tool arguments, such as through indirect prompt injection against a connected Large Language Model (LLM) agent, can inject the --set flag to override Helm chart values like tap.docker.registry. Because Kubeshark deploys its worker DaemonSet with privileged security contexts and host networking enabled, redirecting the container image registry allows arbitrary code execution as root across all Kubernetes cluster nodes.

Alon Barad
Alon Barad
6 views•11 min read