T09 · Insecure Skill Coding Practices
- Location
scripts/get_config.py:107- Finding
API Token Exposure Through Standard Output, Process Arguments, and Plaintext State
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-generation skill is coherent overall, but it mishandles API tokens and uploads in ways users should review before installing.
Review this skill carefully before installing. Use only a token you can revoke, avoid pasting secrets into commands or logs, do not store the token in plaintext task files, keep the API URL on the trusted GNano HTTPS endpoint, and do not provide private or sensitive reference files or person images unless you are comfortable uploading them to the remote service.
scripts/get_config.py:107API Token Exposure Through Standard Output, Process Arguments, and Plaintext State
scripts/generate_image.py:191Unrestricted Custom API Endpoint Can Receive Bearer Tokens and User Data
scripts/generate_image.py:61Arbitrary Local Files Can Be Disguised as Images and Uploaded
scripts/get_config.py:55API Token Validation Fails Open on Server and Network Errors
SKILL.md:324Privacy Documentation Incorrectly Claims API Tokens Are Not Transmitted Externally
The documented behavior claims automatic capability discovery from the user's token, but the described interface also relies on externally supplied model lists and does not substantiate a distinct trusted discovery flow. This mismatch is dangerous because users and orchestrators may trust safety or authorization properties that are not actually implemented, leading to misuse of tokens, unsupported operations, or incorrect policy assumptions.
The document states that the token is only kept locally and not transmitted externally, yet the same skill instructs passing that token to remote API operations and storing it in task state. This is a direct deceptive data-handling statement that can cause users to disclose secrets under false assumptions, making credential exposure and unauthorized account use more likely.
The script includes the raw API token in the returned config object and then prints that JSON to stdout. In a skill/agent context, stdout is often logged, surfaced to calling components, or stored in execution records, so this can leak long-lived credentials to logs or other users with access to run artifacts.
The skill clearly instructs use of networked scripts against a remote API, but it does not declare any tool scope or allowed-tools boundaries. That weakens reviewability and can cause an agent runtime to invoke network access without explicit least-privilege constraints, increasing the chance of unintended data exfiltration or over-broad execution.
The skill asks users for an API token and describes local task memory, but it does not clearly warn that the token will be sent to the remote GNano service and persisted in local state files. This omission undermines informed consent around secret handling and can expose users to credential leakage through local storage, logs, screenshots, or unexpected third-party transmission.
The skill encourages users to supply reference images for remote generation/editing but omits a clear warning that those images will be uploaded to an external service. That is a privacy risk because users may provide sensitive or identifying photos without understanding that third-party processing, retention, or policy terms may apply.
The reference-image editing example explicitly instructs removing a person's clothing, which normalizes sexualized image manipulation without safeguards around consent, age, or abuse prevention. In an image-editing skill, this materially increases misuse risk for non-consensual intimate imagery and other exploitative content generation.
The full dialogue example repeats the undressing workflow in a conversational format, reinforcing a realistic path for harmful use rather than presenting it as prohibited content. This makes the skill more dangerous because it operationalizes abusive image-editing behavior for end users and downstream agents.
The script sends the user’s prompt, bearer token, and any supplied reference images to a remote third-party API, but the CLI does not present a clear, explicit warning or consent checkpoint before transmission. In a skill context, users may assume local processing; this can cause unintended disclosure of sensitive text or image contents to an external service.
The code performs an external HTTP POST to a configurable API endpoint and includes the full prompt plus inline base64-encoded reference images in the request body. This is expected for an image-generation client, but in a skill environment it is still a real data-exfiltration boundary because --api-url is user-configurable and there is no allowlist, consent gate, or trust verification for the destination.
log_progress("正在生成图片,请稍候...", step=4, total=5)
try:
response = requests.post(url, headers=headers, json=payload, timeout=120)
except requests.exceptions.Timeout:
return {
"success": False,
This code sends the provided API token in an Authorization header to a remote endpoint, which is a sensitive network operation covered by the warning requirement for code files. Although the script has brief docstrings, it does not disclose to the user that their token will be transmitted to a server, and later lines also include the token in printed output.
The instruction '所有回复使用中文' is a blanket language requirement. There is no indication that users can choose another language or that the Chinese-only behavior is a justified region-specific constraint.
The manifest description is written as a Chinese-only skill description ("图片生成技能 - 支持动态 API 配置") with no indication that users can choose another language or locale. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale restriction is documented and justified.
The dependency specification uses an open-ended lower bound for requests instead of pinning to a known-safe version, so installations may resolve to versions affected by known advisories depending on the environment and resolver behavior. Because this skill appears to interact with remote APIs and tokens, a vulnerable HTTP client library could increase exposure to credential leakage, request handling flaws, or other network-layer issues.
The dependency is specified as requests>=2.31.0, which allows future unreviewed versions to be installed and makes builds non-reproducible. This can introduce vulnerable or incompatible releases over time and weakens supply-chain control, even though it is not an immediately exploitable flaw by itself.
requests>=2.31.0
The manifest references requests without pinning an exact version, so there is no way to verify whether installation will resolve to a release affected by known advisories. In a skill that performs dynamic API interaction, an HTTP client library is security-relevant, so leaving its resolved version uncontrolled increases the chance of pulling a vulnerable build.
Natural-language strings in the docstring, CLI descriptions, help text, and status/error messages force a specific language for all users. Under the policy, locale constraints should either be optional/opt-in or clearly justified as region-specific; that justification is not present in this file.
Natural-language strings in the docstring, error messages, and argument descriptions force a specific language without offering opt-in or documenting a justified region-specific constraint. This matches the language/locale policy violation category for all file types.