Back to skill

Security audit

Vision Sandbox

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: sends a user-chosen image and prompt to Gemini for visual analysis, with no evidence of hidden persistence, credential theft, or unrelated local access.

Install only if you are comfortable sending the chosen images and prompts to Gemini/Google for processing. Avoid using sensitive screenshots, secrets, regulated data, or private customer material unless your policies allow it, and run it from a directory where sandbox_output_*.png filename collisions will not matter.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Note
Location
scripts/vision_executor.py:69
Finding

Predictable Output Filename Allows Silent File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/vision_executor.py, lines 69–72
Vulnerability Type: Predictable output path and unsafe file creation
Risk Level: Low

python
out_path = f"sandbox_output_{i}_{j}.png"
with open(out_path, "wb") as f:
    f.write(part.inline_data.data)
print(f"\nMEDIA: {os.path.abspath(out_path)}")

Technical Analysis

Inline data returned by the remote model is written to a predictable filename in the current working directory. Opening the path with wb silently truncates any existing file with the same name.

The implementation does not use exclusive creation, generate a collision-resistant filename, check whether the destination already exists, or require the user to approve replacement. Although the remote response controls the file contents, the filename is derived from candidate and part indexes rather than directly from attacker-controlled path data. Consequently, this is a constrained overwrite issue rather than an arbitrary-path write.

Attack Path

  1. An attacker influences the submitted image or prompt, or otherwise causes the Gemini response to include inline image data.
  2. The user runs the CLI from a directory containing a file named according to the predictable pattern, such as sandbox_output_0_2.png.
  3. The application iterates over the returned candidate parts and constructs that same output path.
  4. open(out_path, "wb") truncates the existing file.
  5. Model-returned bytes replace the prior contents without warning or confirmation.

Impact Assessment

Exploitation can destroy or replace files matching the sandbox_output_{i}_{j}.png naming pattern in the process's current working directory. The write occurs with the privileges of the user running the CLI.

No arbitrary path traversal, privilege escalation, persistence, or overwrite of unrestricted filenames was identified. Practical impact is therefore limited to predictable matching file ...[truncated 38 chars]

Remediation
View remediation

Remediation Suggestions

  • Store generated files in a dedicated output directory selected explicitly by the user.
  • Generate collision-resistant names, for example with uuid.uuid4() or tempfile.
  • Use exclusive creation mode (xb) to prevent silent replacement.
  • If deterministic filenames are required, check for an existing destination and refuse to overwrite it unless the user supplies an explicit --overwrite option.
  • Resolve and validate the destination against the intended output directory before writing.
  • Consider atomic file creation and replacement procedures where output integrity is important.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README instructs users to configure a Gemini API key and submit images/prompts for processing, but it does not clearly disclose that those inputs will be transmitted to an external third-party service. This creates a real privacy and data-handling risk because users may upload sensitive screenshots, UI captures, or proprietary visual material without informed consent about where the data goes.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · README.md (reported line 5)May include surrounding context.

md
Agentic Vision via Gemini's native Python code execution sandbox. 

Instead of just "guessing" what's in an image, the model can write and execute code to verify spatial relationships, count objects, or perform complex visual reasoning with pixel-level precision.

## 🚀 Primary Use Cases

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

Copy SKILL.md to your global OpenCode skills directory:

bash
mkdir -p ~/.config/opencode/skills/vision-sandbox
cp SKILL.md ~/.config/opencode/skills/vision-sandbox/SKILL.md
  1. Project Installation:

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 65)May include surrounding context.

Copy SKILL.md to your global OpenCode skills directory:

bash
mkdir -p ~/.config/opencode/skills/vision-sandbox
cp SKILL.md ~/.config/opencode/skills/vision-sandbox/SKILL.md
  1. Project Installation:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill requires an environment secret (GEMINI_API_KEY) and describes code-execution capabilities, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an overbroad trust boundary: an agent or runtime may expose more capabilities than intended, and users cannot clearly audit what the skill is allowed to access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends raw image bytes and the user-supplied prompt to an external Gemini API, but provides no explicit consent flow, warning, or data-classification check before transmission. In a vision skill, images may contain sensitive information such as screenshots, documents, credentials, faces, or internal UI data, so silent exfiltration to a third-party service creates a real privacy and compliance risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.