Back to skill

Security audit

gemini-mcp

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for Gemini media generation, but its setup runs an unpinned third-party MCP server that can use a Gemini API key and handle local or clipboard media.

Install only if you trust the `@chrischall/gemini-mcp` package and are comfortable giving it a Gemini API key plus access to selected media files or clipboard images. Prefer a pinned reviewed version, a dedicated API key with billing limits, a restricted input/output directory, and explicit confirmation before uploading local or clipboard-derived content.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:15
Finding
Unpinned Third-Party Package Is Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15-38` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```markdown ### Option A — npx (recommended) Add to `.mcp.json` in your project or `~/.claude/mcp.json`: ```json { "mcpServers": { "gemini": { "command": "npx", "args": ["-y", "@chrischall/gemini-mcp"], "env": { "GEMINI_API_KEY": "your-api-key-here" } } } } ``` ### Option B — from source ```bash git clone https://github.com/chrischall/gemini-mcp cd gemini-mcp npm install && npm run build ``` ``` ### Technical Analysis The recommended configuration uses `npx -y` to download and execute `@chrischall/gemini-mcp` without pinning a reviewed package version or verifying package integrity. The `-y` option suppresses the interactive installation prompt, allowing the currently resolved package release to execute automatically. The source-install alternative similarly clones a mutable repository branch without selecting a reviewed commit or release tag, then installs and runs its dependency tree. The instructions do not require lockfile verification, integrity validation, or `npm ci`. The MCP server implementation and dependency lockfile are not included in the audited artifact. Consequently, the runtime behavior of the downloaded package—including its handling of API credentials, local files, clipboard contents, and network requests—cannot be verified from this project. This finding identifies supply-chain exposure; it does not establish that the named package is currently malicious. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, source repository, release process, or a transitive dependency. 2. The attacker publishes malicious code under a version that the unpinned package reference can resolve to, or modifies the repository branch cloned by the documented source-install command. 3. A user follows the ...[truncated 1241 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the npm dependency to a specific, reviewed version: ```json { "command": "npx", "args": ["-y", "@chrischall/gemini-mcp@<reviewed-version>"] } ``` 2. Prefer a locally installed dependency governed by a committed lockfile rather than downloading executable code when the MCP server starts. 3. For source installation: - Check out a reviewed commit SHA rather than a mutable branch. - Verify the repository origin, release signature, or documented checksum. - Commit and review the package lockfile. - Use `npm ci` instead of `npm install` to enforce locked dependency versions. 4. Record expected package and artifact integrity hashes and verify them before execution. 5. Run the MCP server with least privilege: - Restrict filesystem access to required input and output directories. - Prevent access to unrelated credentials and configuration files. - Limit outbound network access to documented Gemini endpoints where practical. - Isolate the process in a container or operating-system sandbox. - Supply a dedicated, narrowly scoped API key with billing limits and rotation procedures. 6. Audit dependency updates before changing the pinned version, including transitive dependency and lifecycle-script changes. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

MCP Config Access

High
Category
Agent Snooping
Content
### Option A — npx (recommended)

Add to `.mcp.json` in your project or `~/.claude/mcp.json`:

```json
{
Confidence
95% confidence
Finding
Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: gemini-mcp
description: Generate and edit images, video, and music with Google Gemini models via MCP. Use when the user asks to generate, create, or edit images (Gemini / Nano Banana), produce a consistent set of images, compose/blend multiple images, generate a short video (text→video or image→video, via the omni model), or generate music/audio clips (via Lyria). Triggers on phrases like "generate an image of", "edit this image with Gemini", "create a set of consistent images", "make a video of", "generate a video", "generate music", "make a song/audio clip", "use Nano Banana to make", or any request to produce images, video, or music via the Gemini API. Requires the @chrischall/gemini-mcp package installed and the gemini server registered (see Setup below).
---

# gemini-mcp
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill description says it triggers on specific phrases "or any request to produce images, video, or music via the Gemini API," which is an open-ended activation condition rather than a bounded trigger list. This broad wording makes it unclear where invocation stops and could overlap with many ordinary media-generation requests.

External Transmission

Medium
Category
Data Exfiltration
Content
`/mcp` — the zero-base64 path for an agent with a shell:

```bash
curl -X POST https://<hosted deployment>/upload \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg
Confidence
89% confidence
Finding
The documented `/upload` flow transmits local file contents to a remote hosted deployment using an OAuth bearer token. External transmission is expected for this skill's purpose, but if invoked without clear consent and source restrictions it can send sensitive local media off-host, making data exfiltration possible through a legitimate-looking workflow.

External Transmission

Medium
Category
Data Exfiltration
Content
**Reuse one photo across many generations (hosted hosted deployment, agent with a shell):**
```
$ curl -X POST https://<hosted deployment>/upload -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: image/jpeg" --data-binary @photo.jpg
  → {"file_uri": "files/abc123"}
Confidence
89% confidence
Finding
This example again demonstrates direct upload of a local file to a remote service for reuse. Because the skill handles user-provided or locally accessible media, the ability to transmit those bytes externally is security-relevant and can expose sensitive data if the workflow is triggered on the wrong file or without adequate consent.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill exposes `from_clipboard: true`, allowing the MCP server to read image data directly from the system clipboard. Clipboard contents may include sensitive user data unrelated to the current task, so broad clipboard access expands the trust boundary beyond stated media-generation inputs and can enable unintended local data capture and transmission to external services.

Description-Behavior Mismatch

Low
Confidence
77% confidence
Finding
Lines L258-L266 state that pasted or attached images cannot be fed to the tools directly because the assistant lacks the original bytes. Immediately after, L268-L276 presents built-in workarounds including `from_clipboard: true`, where the tool itself reads an image from the system clipboard, and `GEMINI_INPUT_DIR` filename resolution. This creates a documentation-level mismatch about what image inputs the skill can practically consume.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The note recommends "Best-performance languages: EN, plus ... — prefer prompting in one of these," which expresses a locale/language preference in the skill instructions. Because it does not clearly frame this as optional user choice, it may pressure use of particular languages without explicit opt-in.

Static analysis

No suspicious patterns detected.