T09 · Insecure Skill Coding Practices
- Location
scripts/gpt_image_cli.js:448- Finding
Official API credentials can be transmitted to an arbitrary or cleartext endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent image-generation tool, but it can send prompts, images, and credentials to configurable services with weak endpoint safeguards that users should review before installing.
Install only if you trust the image backend you configure. Prefer official mode without overriding OPENAI_BASE_URL, avoid passing secrets as command-line arguments, use environment or secret-manager injection instead, and treat proxy or reserved relay modes as third-party data sharing for prompts and source images.
scripts/gpt_image_cli.js:448Official API credentials can be transmitted to an arbitrary or cleartext endpoint
scripts/gpt_image_cli.js:143Relay-controlled image URL enables server-side request forgery
SKILL.md:44Sensitive credentials are passed through process command-line arguments
Referenced artifact was not completely inspected
The main script is [scripts/gpt_image_cli.js](scripts/gpt_image_cli.js). Run it with Node 18+. In OpenClaw, reference it as `{baseDir}/scripts/gpt_image_cli.js`
The output rules instruct the agent to always return the absolute output path plus decisive metadata including endpoint/relay job ID and any revised prompt. Exposing internal filesystem paths and service metadata can leak environmental details useful for reconnaissance, and returning revised prompts may reveal provider-side transformations or sensitive prompt content that the user did not explicitly request back.
- Read [references/access-modes.md](references/access-modes.md) when choosing among official, proxy, and reserved entries or when a user asks how to configure them.
- Read [references/runtime.md](references/runtime.md) when debugging generation, SSE parsing, relay quota, OpenClaw/Hermes packaging, or the relationship to the original `gpt_image` project.
## Output Rules
Always return the absolute output image path and the decisive metadata: access mode, endpoint or relay job ID, provider name when available, byte size, and any revised prompt returned by the model. Keep credentials redacted.
The skill invokes a Node CLI that uses environment variables and makes outbound network requests, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates a trust and sandboxing gap: agents or platforms may allow broader execution than users expect, increasing the risk of unintended secret access or arbitrary external calls.
The skill enables implicit invocation but provides no explicit gating conditions, scope limits, or user-confirmation requirements. Because this skill can trigger image generation through official keys, custom proxies, or reserved-capacity relays, over-broad automatic activation could cause unintended external API usage, quota consumption, or routing of user prompts to third-party infrastructure without sufficiently explicit user intent.
The reserved mode documentation instructs users to send a user ID, optional profile name, purchase key, and potentially a local image (converted to a data URL) to a relay service, but it does not clearly warn that this is third-party data transmission. In a skill handling image generation, this matters because prompts and images may contain sensitive personal or business information, and users may assume behavior similar to direct official API usage.
The script allows prompts and optional input images to be sent to a user-supplied proxy or relay endpoint, not just the official OpenAI API. In this skill context, prompts and images may contain sensitive user data, and the CLI does not provide an explicit warning, trust check, or endpoint allowlist before transmitting them to arbitrary services.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const baseUrl =
mode === 'official'
? stringValue(args['base-url'], process.env.OPENAI_BASE_URL) || 'https://api.openai.com/v1'
: requireValue('base-url or GPT_IMAGE_BASE_URL', stringValue(args['base-url'], process.env.GPT_IMAGE_BASE_URL));
const inputImage = readImageDataUrl(stringValue(args.image, process.env.GPT_IMAGE_INPUT_IMAGE));
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const baseUrl =
mode === 'official'
? stringValue(args['base-url'], process.env.OPENAI_BASE_URL) || 'https://api.openai.com/v1'
: requireValue('base-url or GPT_IMAGE_BASE_URL', stringValue(args['base-url'], process.env.GPT_IMAGE_BASE_URL));
const inputImage = readImageDataUrl(stringValue(args.image, process.env.GPT_IMAGE_INPUT_IMAGE));
The skill README switches from English to Chinese for the sponsorship section and several example prompts, but does not state that Chinese is optional or offer a language preference. Under the stated policy, forcing or assuming a specific language without user opt-in can be a natural-language policy issue.
The skill description is presented in Chinese on one line and English on another, but there is no indication that language selection is based on user preference or opt-in. This may create an inconsistent language experience and can violate a language/locale policy if users are expected to receive content in their chosen language.
The example command includes a Chinese prompt as the presented usage pattern, and another example later does the same. In the absence of any note that prompt language is optional or user-selected, this can be read as imposing a specific language preference, which falls under the language/locale policy check.
This example again presents Chinese as the default prompt language with no surrounding text offering language choice. Repeated single-locale examples can create an implicit language constraint in documentation.
The session command can persist serviceUrl, userId, and profile-related state to a predictable file in the user's home directory without prominently disclosing that persistence behavior. While it does not store high-value secrets here, writing identifiers and service metadata to disk can create privacy and operational leakage, especially on shared systems.
Detected: suspicious.env_credential_access