GHSA-C5PX-58J2-7FQP

Vulnerability from github – Published: 2026-07-31 22:31 – Updated: 2026-07-31 22:31
VLAI
Summary
gemini-bridge vulnerable to arbitrary local file read via consult_gemini_with_files inline mode
Details

Summary

consult_gemini_with_files in inline mode read any file path supplied in the files argument without confining it to the working directory, then forwarded the contents to the Gemini CLI. Because the caller also controls query, the file contents are echoed back through the Gemini round-trip (and sent to Google), making this an arbitrary local file read.

Impact

An MCP client — or an LLM that has been prompt-injected into calling the tool — can read any file the server process can access (SSH keys, cloud credentials, .env, source) and have it disclosed via the tool response. No code execution by itself.

Affected component

  • Tool: consult_gemini_with_files(query, directory, files, …), mode="inline"
  • Sink: _read_file_for_inline via _prepare_inline_payload in src/mcp_server.py
  • The at_command mode already confined paths; inline mode did not.

Root cause

_resolve_path returned an out-of-root path while only nullifying the display name, and _prepare_inline_payload read the file regardless. Absolute paths, .. traversal, and symlink escapes were all accepted.

Patch

Fixed in 1.3.1. _resolve_path now resolves symlinks and confines via Path.relative_to(root); inline mode skips any entry that resolves outside the working directory (the same guard at_command already enforced).

Workarounds

Upgrade to 1.3.1. Before upgrading, avoid mode="inline" with untrusted files input, or run the server with a restricted-permission user.

Credit

Reported privately by Zhihao Zhang (WPI).

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "gemini-bridge"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.0.0"
            },
            {
              "fixed": "1.3.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54785"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-200",
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-31T22:31:20Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "### Summary\n`consult_gemini_with_files` in **inline mode** read any file path supplied in\nthe `files` argument without confining it to the working `directory`, then\nforwarded the contents to the Gemini CLI. Because the caller also controls\n`query`, the file contents are echoed back through the Gemini round-trip\n(and sent to Google), making this an arbitrary local file read.\n\n### Impact\nAn MCP client \u2014 or an LLM that has been prompt-injected into calling the tool \u2014\ncan read **any file the server process can access** (SSH keys, cloud\ncredentials, `.env`, source) and have it disclosed via the tool response.\nNo code execution by itself.\n\n### Affected component\n- Tool: `consult_gemini_with_files(query, directory, files, \u2026)`, `mode=\"inline\"`\n- Sink: `_read_file_for_inline` via `_prepare_inline_payload` in `src/mcp_server.py`\n- The `at_command` mode already confined paths; inline mode did not.\n\n### Root cause\n`_resolve_path` returned an out-of-root path while only nullifying the *display*\nname, and `_prepare_inline_payload` read the file regardless. Absolute paths,\n`..` traversal, and symlink escapes were all accepted.\n\n### Patch\nFixed in **1.3.1**. `_resolve_path` now resolves symlinks and confines via\n`Path.relative_to(root)`; inline mode skips any entry that resolves outside the\nworking directory (the same guard `at_command` already enforced).\n\n### Workarounds\nUpgrade to 1.3.1. Before upgrading, avoid `mode=\"inline\"` with untrusted\n`files` input, or run the server with a restricted-permission user.\n\n### Credit\nReported privately by Zhihao Zhang (WPI).",
  "id": "GHSA-c5px-58j2-7fqp",
  "modified": "2026-07-31T22:31:20Z",
  "published": "2026-07-31T22:31:20Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/eLyiN/gemini-bridge/security/advisories/GHSA-c5px-58j2-7fqp"
    },
    {
      "type": "WEB",
      "url": "https://github.com/eLyiN/gemini-bridge/pull/9"
    },
    {
      "type": "WEB",
      "url": "https://github.com/eLyiN/gemini-bridge/commit/8f3b85afd02b692c4bc974b5176e12fb277ea801"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/eLyiN/gemini-bridge"
    },
    {
      "type": "WEB",
      "url": "https://github.com/eLyiN/gemini-bridge/releases/tag/v1.3.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "gemini-bridge vulnerable to arbitrary local file read via consult_gemini_with_files inline mode"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…