T09 · Insecure Skill Coding Practices
- Location
scripts/gemini-image-runtime.mjs:122- Finding
Unvalidated Custom Gemini Endpoint Can Receive API Credentials and User Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does what it claims, but it needs review because it can send prompts, images, and the Gemini API key to a configurable endpoint and its scripts do not enforce workspace-only file paths.
Review before installing. Use only a trusted Gemini endpoint, avoid setting GEMINI_BASE_URL unless you control and trust it, provide a narrowly scoped API key, and only run the scripts on images and output paths you explicitly intend to share or overwrite. Treat source images and prompts as data that will leave the local machine.
scripts/gemini-image-runtime.mjs:122Unvalidated Custom Gemini Endpoint Can Receive API Credentials and User Content
scripts/gemini-image-runtime.mjs:143Unrestricted Input and Output Paths Permit Local File Disclosure and Arbitrary File Overwrite
Artifact content does not match its filename extension
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.
# Image Generation
Use this skill when you need to create one or more image files from a text prompt, or edit one or more existing images with Gemini.
## Requirements
The skill explicitly instructs users to send prompts and potentially source images to Gemini via an external API, but it does not warn users that their content leaves the local environment for third-party processing. This creates a privacy and data-handling risk, especially if users provide sensitive images or confidential prompt content under the assumption the operation is local.
The code reads local image files, base64-encodes them, and prepares them for submission via the GoogleGenAI client, which results in user-provided file contents being sent over the network. This file does not include a confirmation prompt, user-facing notice, or explanatory comment warning that local image data will be transmitted to a third-party service.
The function creates directories and writes returned image data to the filesystem, which is a safety-relevant file write operation. In this file there is no confirmation prompt, user-facing log/print, or explanatory comment/docstring disclosing that generated content will be saved to the specified path.
This code performs a network call to an external AI service using user-supplied prompt data, but the file itself does not include a confirmation prompt, warning comment, or docstring disclosing that the prompt will be transmitted off-box. The later console output only reports results after the call, so it does not function as a prior user-facing warning about data transmission.
The dependency uses a caret range (^1.44.0), which permits automatic installation of newer compatible versions. This creates a supply-chain risk because a compromised or buggy upstream release could be pulled in without deliberate review, affecting image-generation functionality that likely handles external prompts and API interactions.
"private": true,
"type": "module",
"dependencies": {
"@google/genai": "^1.44.0"
}
}
The runtime pulls GEMINI_API_KEY, GEMINI_MODEL_ID, and optionally GEMINI_BASE_URL from process.env to configure the client. While network access to Gemini is expected for this skill, direct environment-variable access is an additional capability not reflected in the manifest description, which only describes generating or editing images in a workflow.
The code accesses GEMINI_API_KEY from the environment to authenticate outbound API calls. Although this is common, it falls under sensitive credential access and this file provides no comment, docstring, or user-facing notice explaining the dependency on environment-stored credentials.
The script saves generated images to the user-specified output location, which is a file write operation. Although the save is part of the apparent purpose of the script, this file contains no prior comment, docstring, or user-facing notice that files will be created or overwritten at the provided path.
No suspicious patterns detected.