T09 · Insecure Skill Coding Practices
- Location
scripts/generate-image.mjs:61- Finding
Unrestricted server override permits API key exfiltration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its image-generation purpose, but it handles the VisNote API key in ways that could leak it.
Review this before installing if you will use a real VisNote API key. Use only the official VisNote server, avoid passing --server, keep config.json out of version control, consider rotating any key used with this script, and prefer pinned Playwright dependencies.
scripts/generate-image.mjs:61Unrestricted server override permits API key exfiltration
scripts/generate-image.mjs:148Long-lived API key is exposed in an editor URL query string
The skill directs the agent to make external API calls and use browser/network-backed automation, but it declares no explicit tool scope such as allowed-tools or permissions. That mismatch weakens governance and consent boundaries, making it easier for an agent runtime to perform network actions without clear review or policy enforcement.
The file mandates a specific Chinese response to the user when the API key is missing, and the overall examples/instructions are written as if Chinese output is expected by default. The policy only permits locale constraints when the skill offers user choice or clearly documents and justifies the restriction; that justification is not stated here.
The skill tells the agent to construct and execute shell commands that write files and trigger browser/network-backed automation, but it does not require an explicit user warning or confirmation before those side effects occur. In an agent setting, this increases the chance of unanticipated file writes, command execution, or automation against remote services without informed consent.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Usage:
# Get all templates
curl "https://vis-note.netlify.app/api/open/templates"
# Search templates by keyword
curl "https://vis-note.netlify.app/api/open/templates?keyword=封面"
The manifest describes selecting templates, merging data, and invoking an image generation script, but these instructions also direct the agent to create or overwrite config.json containing an API key. Managing local credential files is a separate capability from generating XiaoHongShu-style images and expands the agent's role into secret/configuration handling.
Using npx playwright without pinning a specific version allows resolution of whatever package/version is current at execution time. This creates a supply-chain and reproducibility risk, where a malicious or compromised upstream release could change behavior or execute unexpected code on the host.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
The script accepts an arbitrary --server value and then sends the bearer API key to that host in checkApiKeyStatus and navigates a browser to that same origin. This allows a caller to exfiltrate credentials to an attacker-controlled server and drive headless browser automation against untrusted content, which exceeds the expected image-generation scope and is especially risky in an agent skill context where arguments may be influenced indirectly.
The editor URL includes apikey as a query parameter, exposing the secret to browser history, logs, crash reports, proxy infrastructure, referrer leakage, and any scripts on the destination page. In this skill, the risk is amplified because the page is loaded in an automated browser and the destination can be changed via --server, enabling straightforward credential capture.
Sending the API key in the page URL causes network disclosure of a long-lived secret without any warning or consent, making accidental leakage likely even during normal operation. While this overlaps with the prior finding, it remains a valid issue because the script's interface gives operators no indication that invoking image generation will disclose credentials at the navigation layer.
The manifest description states the skill is a "XiaoHongShu-style image generator," which hard-codes a specific platform/style locale in the skill’s behavior. There is no indication in this file that users can opt in to or choose an alternative language/locale/style context.
The skill description says it "intelligently matches templates, and generates XiaoHongShu-style images," again presenting a fixed locale/platform-specific output mode. Because no user choice or opt-in is mentioned here, this may conflict with language/locale policy requirements.
The dependency uses a caret range (^1.58.2), which allows installation of newer compatible releases and makes builds non-reproducible. In a security-sensitive automation skill that may fetch and execute browser-related components, this increases supply-chain risk because different environments may resolve to different code than what was tested.
"author": "",
"license": "ISC",
"dependencies": {
"playwright": "^1.58.2"
}
}
The manifest references playwright without exact version pinning, while the package has a known advisory related to downloading and installing browsers without authenticity verification. Because the resolved version is not fixed, consumers may install an affected release, which is more concerning here because the skill's purpose includes automated image generation and may invoke tooling that downloads browser binaries as part of setup or execution.