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



CVE-2026-54785

CVE-2026-54785: Local File Read via Directory Traversal in gemini-bridge MCP Server

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 1, 2026·6 min read·32 visits

Executive Summary (TL;DR)

A path traversal vulnerability in gemini-bridge allows attackers to read arbitrary local files by exploiting improper canonicalization and a missing validation check in the server's inline payload preprocessor.

Between versions 1.0.0 and 1.3.1, the gemini-bridge Model Context Protocol (MCP) server failed to restrict candidate file paths to the workspace root when processing files in inline mode. This allowed unauthenticated local users, or remote attackers executing prompt-injection payloads against connected AI agents, to traverse the directory tree and read arbitrary system files. The retrieved contents were subsequently forwarded to the external Gemini AI CLI and returned in the round-trip response.

Vulnerability Overview

The gemini-bridge package is an integration framework designed to connect Model Context Protocol (MCP) clients, such as Claude Code, with Google's Gemini AI engine via the official CLI tool. To enrich prompt contexts, the server exposes the consult_gemini_with_files tool, allowing client agents to attach specific workspace files to their outgoing queries. This establishes a high-trust attack surface, as the server must strictly regulate the directory paths it accesses to prevent unauthorized file extraction.

Historically, the server operated under the assumption that path resolution logic would confine the candidate file paths to a specified, secure working directory. However, the path translation workflow in inline mode did not implement adequate checks, enabling arbitrary absolute or relative paths to bypass restriction boundaries. As a result, the tool could be coerced into reading sensitive system configuration files, credentials, or private workspace assets.

Once read, the file contents were seamlessly attached to the outgoing query structure and processed by the LLM CLI. Because the client controls both the target path and the command prompt, an attacker can instruct the model to echo the loaded file verbatim, bypassing typical boundary barriers. This transforms a simple traversal issue into a full disclosure pipeline.

Root Cause Analysis

The root cause of this vulnerability lies in two distinct flaws in src/mcp_server.py. The first flaw is the absence of canonicalization within the _resolve_path function. The function did not utilize Python's Path.resolve() method, which meant that symbolic links, Windows 8.3 short names, and relative path traversals (e.g., ../) were not expanded to their absolute real paths prior to validation.

def _resolve_path(directory: str, candidate: str) -> tuple[str, str | None]:
    candidate_path = Path(candidate)
    abs_path = (
        str(candidate_path)
        if candidate_path.is_absolute()
        else str(Path(directory) / candidate)
    )
    try:
        # Fails to resolve canonical paths before computing relative relation
        rel_path = os.path.relpath(abs_path, directory)
    except ValueError:
        rel_path = None
    if rel_path and rel_path.startswith(".."):
        rel_path = None
    return abs_path, rel_path

The second, more critical flaw resides in how the _prepare_inline_payload function processed the outputs returned by _resolve_path. When a traversal path or an absolute path escaping the root directory was parsed, _resolve_path correctly detected that the path escaped the root and returned rel_path = None.

However, the calling loop in _prepare_inline_payload did not verify whether rel_path was None. Instead of skipping the file, it executed a fallback option display_name = rel_path or Path(abs_path).name and then directly loaded the file from the unconfined abs_path variable. This allowed any arbitrary file path to pass through the validation check and be read.

Code-Level Patch Analysis

The vulnerability was mitigated in version 1.3.1 (Commit 8f3b85afd02b692c4bc974b5176e12fb277ea801). The patch introduces strict canonicalization via Python's Path.resolve() and adds explicit condition checks to the inline payload processing logic.

In the patched implementation, both the workspace root and the target candidate paths are fully resolved to strip out traversals and symbolic link tricks. This canonicalized target is then verified against the canonicalized root directory using abs_path.relative_to(root):

# Annotated Patch Changes in src/mcp_server.py
 
def _resolve_path(directory: str, candidate: str) -> tuple[str, str | None]:
    # Resolve the working directory root and any symbolic links
    root = Path(directory).resolve()
    candidate_path = Path(candidate)
    # Compute and resolve the absolute candidate path
    abs_path = (
        candidate_path if candidate_path.is_absolute() else root / candidate
    ).resolve()
    try:
        # Ensure candidate strictly resides under root using relative_to
        rel_path = str(abs_path.relative_to(root))
    except ValueError:
        # Throws ValueError if candidate is outside root boundaries
        rel_path = None
    return str(abs_path), rel_path

Additionally, the patch enforces the path traversal boundary check in the calling loop of _prepare_inline_payload:

    for original_path in files:
        abs_path, rel_path = _resolve_path(directory, original_path)
        # If rel_path is None, the path escaped the root. The file is skipped.
        if rel_path is None:
            warnings.append(
                f"Skipped file outside working directory: {original_path}",
            )
            continue
        display_name = rel_path

This combined patch ensures that unconfined file paths are discarded before any filesystem reads can occur, effectively mitigating the arbitrary read vector.

Exploitation and Attack Scenarios

An attacker can exploit this vulnerability through local command execution or indirect prompt injection vectors. The primary prerequisite is that the gemini-bridge service must be active and listening for tool calls, which is typical when integrated with an automated agent workflow.

In a direct exploitation scenario, the user or local system components make a direct tool call to the MCP server. By supplying a directory value and an out-of-bounds target file path, they can force the server to load arbitrary files:

{
  "method": "tools/call",
  "params": {
    "name": "consult_gemini_with_files",
    "arguments": {
      "query": "Please summarize this file verbatim:",
      "directory": "/home/user/workspace",
      "files": ["../../../../etc/passwd"],
      "mode": "inline"
    }
  }
}

In an indirect prompt injection attack, a remote attacker can structure an injection payload (e.g., in a public Git repository description or an issue comment) that trick the client AI agent. When the agent processes the injection, it is instructed to invoke consult_gemini_with_files with malicious parameters, silently exfiltrating targeted system files such as SSH keys or .env credential files.

Impact Assessment

The confidentiality impact of this vulnerability is high. Because the application runs with the privileges of the local system user running the MCP server, any file readable by that user's shell can be retrieved. This exposes sensitive items such as SSH private keys, environment variables containing API keys, local databases, and configuration settings.

The CVSS v3.1 score is evaluated at 6.2 (Medium), with the vector CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. While classified as a local attack vector (AV:L), the emergence of indirect prompt injection vectors against AI agents allows remote actors to trigger the exploit sequence without possessing direct local console access.

No active exploitation in the wild has been observed, nor has this CVE been listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, due to the ease of automated exploitation of prompt-injection targets, instances utilizing unpatched server versions face elevated risk.

Remediation and Defensive Countermeasures

The primary remediation for this vulnerability is to upgrade the gemini-bridge package to version 1.3.1 or higher. This release integrates the necessary code-level path validation and canonicalization patches to successfully neutralize directory traversals.

For deployments where immediate updates are not feasible, you can apply temporary mitigations. Restricting write access to the workspace directory prevents attackers from writing symbolic links pointing to sensitive system files. Furthermore, you should deploy the server inside a containerized sandbox or under a restricted user account with minimal filesystem privileges.

Finally, because the tool interface allows specifying the directory argument dynamically, developers should modify client-side integrations to enforce hardcoded, system-defined root paths. This ensures that the agent cannot be tricked into redefining the root workspace to a broader path (like / or C:\) during runtime.

Official Patches

eLyiNGitHub Security Advisory GHSA-c5px-58j2-7fqp

Fix Analysis (1)

Technical Appendix

CVSS Score
6.2/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected Systems

gemini-bridge installations running versions 1.0.0 through 1.3.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
gemini-bridge
eLyiN
>= 1.0.0, < 1.3.11.3.1
AttributeDetail
CWE IDCWE-22
Secondary CWE IDCWE-200
Attack VectorLocal
CVSS v3.1 Score6.2
Exploit MaturityProof-of-Concept (PoC)
CISA KEV StatusNot Listed
Ransomware UseNo

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
T1552Unsecured Credentials
Credential Access
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 within a restricted directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location outside of the restricted directory.

Vulnerability Timeline

Vulnerability reported privately by researcher
2026-06-09
Pull Request #9 merged, correcting the path traversal
2026-06-09
Version 1.3.1 released on PyPI
2026-06-09
CVE-2026-54785 published in NVD
2026-07-31

References & Sources

  • [1]GitHub Security Advisory (GHSA-c5px-58j2-7fqp)
  • [2]Pull Request #9
  • [3]Fix Commit (8f3b85a)
  • [4]Release Tag (v1.3.1)
  • [5]CVE Record on CVE.org

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

•14 minutes ago•CVE-2026-91113
4.3

CVE-2026-91113: Missing Authorization and Arbitrary Record Type Conversion in Silverstripe Framework GridFieldDetailForm

A missing authorization and type validation vulnerability in Silverstripe Framework prior to version 6.2.13 allows authenticated CMS users to convert database records into arbitrary DataObject classes via user-controlled ClassName parameters in GridField detail forms.

Alon Barad
Alon Barad
1 views•9 min read
•about 1 hour ago•CVE-2026-91115
8.8

CVE-2026-91115: Remote Code Execution in Silverstripe Framework via i18nTextCollectorTask

CVE-2026-91115 (GHSA-c94f-87xg-65wf) is an unsafe reflection vulnerability in the Silverstripe Framework affecting versions 6.0.0 prior to 6.2.13. The built-in development task i18nTextCollectorTask passes the user-supplied 'writer' parameter directly to Silverstripe's dependency injection container (Injector::inst()->get()) without verifying that the requested class implements the expected Writer interface. Because the dependency injector supports instantiating arbitrary classes with attacker-supplied constructor arguments, and because nested task URLs bypassed interactive confirmation middleware, an attacker can achieve remote code execution via unauthenticated requests on development instances or via Cross-Site Request Forgery (CSRF) against authenticated administrators on production instances.

Amit Schendel
Amit Schendel
4 views•8 min read
•about 2 hours ago•CVE-2026-129237
5.4

CVE-2026-129237: Partial Path Traversal (Zip Slip) in qbee-agent Tar Extractor

CVE-2026-129237 is a partial path traversal (Zip Slip) vulnerability in qbee-agent, the device agent for the qbee.io IoT device management platform. Prior to version 2026.41, the tar archive extraction routine in app/utils/tar.go used strings.HasPrefix without enforcing a directory separator boundary. When the Docker Compose bundle configuration has UseContext enabled, an authenticated user with delegated configuration or file management privileges can supply a crafted tar archive containing sibling-prefix traversal sequences, allowing directory creation and file writes into adjacent sibling directories outside the intended extraction root.

Alon Barad
Alon Barad
3 views•11 min read
•about 3 hours ago•CVE-2026-128118
7.5

CVE-2026-128118: Server-Only Module Guard Bypass and Secret Exposure in SvelteKit

CVE-2026-128118 (GHSA-m9j8-jcmv-hp69) is an information disclosure vulnerability affecting the SvelteKit framework (@sveltejs/kit) from version 3.0.0 through 3.1.0. A design flaw in the build-time Vite module guard plugin (plugin_guard) failed to register src/params.js as a client entry point and implemented a fail-open validation model. Consequently, server-only modules and private environment variables imported directly or dynamically within parameter matchers were compiled into publicly accessible client-side JavaScript bundles without triggering a build error.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 4 hours ago•CVE-2026-128071
6.5

CVE-2026-128071: Route-Rule Authorization Bypass via Encoded Slashes in Nuxt

CVE-2026-128071 is a route-rule authorization bypass and security policy circumvention vulnerability in the Nuxt web framework, affecting `nuxt`, `@nuxt/nitro-server`, and `@nuxt/vite-server` prior to version 4.6.4. Serving as an incomplete fix for GHSA-6gq8-jgmh-3ffp, the flaw arises from an interpretation conflict between Nuxt's route-rule matching logic and Vue Router's catch-all route parameter decoding. When processing an incoming HTTP request containing percent-encoded forward slashes (`%2F` or `%2f`), the route-rule evaluation engine preserves the encoded sequence as a single path segment, failing to match prefix-based rules such as `/admin/**`. However, when the request is subsequently dispatched to a catch-all page route (`app/pages/[...slug].vue`) or a multi-segment parameter handler, the parameters are URL-decoded into literal slash delimiters. This discrepancy allows unauthenticated remote attackers to bypass route-level redirects, authentication middleware (`appMiddleware`), security headers, proxy configurations, and rendering constraints (`ssr: false`, `noScripts`), while the catch-all page resolves and renders the protected resource.

Amit Schendel
Amit Schendel
4 views•11 min read
•about 5 hours ago•CVE-2026-128134
7.8

CVE-2026-128134: Local Code Execution via Untrusted Search Path in NLTK dependencygraph

In Natural Language Toolkit (NLTK) versions prior to 3.10.4, the nltk.parse.dependencygraph.dot2img function resolves the Graphviz dot binary through the system PATH using find_binary('dot') and invokes it directly via subprocess.run() instead of routing execution through nltk.pathsec.spawn_trusted(). This omission bypasses file ownership validation, directory writability checks, and dynamic loader environment scrubbing. On multi-user POSIX systems where a victim's PATH contains a directory writable by a local low-privileged attacker, the attacker can plant a malicious dot binary that executes under the victim's privileges when dependency graphs are rendered.

Amit Schendel
Amit Schendel
4 views•11 min read