T09 · Insecure Skill Coding Practices
- Location
scripts/generate_images_doubao.py:21- Finding
Arbitrary API endpoint can receive the configured API key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is meant to help prepare Xiaohongshu posts, but it bundles under-disclosed tools that can publish, comment, read account data, and send API keys to configurable network destinations.
Review this carefully before installing. Use it only with a Xiaohongshu account you are comfortable automating, avoid invoking the bundled vendor publish commands directly, do not provide untrusted --base-url or --api-key-env values, and avoid untrusted media URLs. Treat the Chrome profile it creates as an authenticated session store.
scripts/generate_images_doubao.py:21Arbitrary API endpoint can receive the configured API key
vendor/xhs/scripts/publish_pipeline.py:574Publishing pipeline automatically publishes by default despite the declared manual-confirmation boundary
vendor/xhs/scripts/image_downloader.py:83Unrestricted media URL downloads permit SSRF and unbounded resource consumption
scripts/setup_vendor_xhs.sh:17Dependency installation uses unpinned versions and upgrades build tooling at install time
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"size": args.size,
"n": 1,
}
resp = requests.post(endpoint, headers=headers, json=payload, timeout=120)
if resp.status_code >= 300:
print(f"API error {resp.status_code}: {resp.text[:400]}", file=sys.stderr)
sys.exit(3)
If the actual behavior auto-publishes by default, controls browser/login sessions, downloads/uploads media, and does not even perform the claimed package-generation workflow, users are being misled about both safety controls and functional scope. Misrepresentation of human-confirmation requirements is particularly dangerous because it can cause unintended account actions under a logged-in browser session.
If the actual behavior auto-publishes by default, controls browser/login sessions, downloads/uploads media, and does not even perform the claimed package-generation workflow, users are being misled about both safety controls and functional scope. Misrepresentation of human-confirmation requirements is particularly dangerous because it can cause unintended account actions under a logged-in browser session.
If the actual behavior auto-publishes by default, controls browser/login sessions, downloads/uploads media, and does not even perform the claimed package-generation workflow, users are being misled about both safety controls and functional scope. Misrepresentation of human-confirmation requirements is particularly dangerous because it can cause unintended account actions under a logged-in browser session.
The file exposes CLI commands that go beyond a 'manual confirmation before publishing' scaffold and can directly perform publish and other account actions. This mismatch is security-relevant because operators or upstream agents may trust the description and invoke the skill under false assumptions, causing unintended external actions on a logged-in account.
The script includes capabilities for feed discovery, detail scraping, comment posting, notification harvesting, and analytics capture that materially exceed a semi-automatic publishing scaffold. In agent settings, hidden overbroad capabilities increase the risk of data collection and unsolicited account actions being triggered without informed consent or least-privilege controls.
Although the workflow messaging says the user should review before publishing, the CLI 'publish' branch immediately invokes _click_publish() and reports PUBLISH_STATUS: PUBLISHED. This creates a direct path for irreversible external posting without a human checkpoint, which is especially dangerous for agent-driven execution.
The script behavior explicitly defaults to publishing posts immediately after form fill, which contradicts the stated skill description that the final publish step is manually confirmed. In an automation skill that can operate browser-driven actions against a live social account, this mismatch is dangerous because callers may reasonably expect a safe preview/package-generation flow but instead trigger irreversible external posting.
The implementation performs real browser automation that fills the Xiaohongshu form and invokes the publish button, rather than only preparing a publish package for later manual action. Given the skill description promises semi-automatic posting with final human confirmation, this creates a capability overreach that can cause unintended live posts to a real account and breaks the user's trust model.
The skill exposes operational behavior that clearly depends on sensitive capabilities such as shell, filesystem access, environment access, and likely network/CDP interaction, but it declares no explicit tool scope or permission boundaries. That increases the chance of over-broad execution, hidden side effects, and user misinformed consent about what the skill may access or modify.
The skill instructs users to connect to a logged-in Xiaohongshu session and auto-fill content into a publish page, but it does not provide a clear warning that the tool will act through an authenticated account and may access or use account-associated data. In the context of social publishing automation, missing consent and safety language makes accidental account actions and privacy misunderstandings more likely.
The script builds a remote API endpoint, reads an API key from an environment variable, and sends the prompt and bearer token in an HTTP request. While network access is central to image generation, the file contains no docstring, comment, or argument help warning that user input and credentials are sent to an external service.
The code unconditionally appends Chinese-language instructions to every prompt, imposing a specific language regardless of the user's original locale or preferences. This is a natural-language policy issue because it forces a language choice without offering an opt-in or configuration.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"size": args.size,
"n": 1,
}
resp = requests.post(endpoint, headers=headers, json=payload, timeout=120)
if resp.status_code >= 300:
print(f"API error {resp.status_code}: {resp.text[:400]}", file=sys.stderr)
sys.exit(3)
The file contains Chinese-only natural-language comments and status messages, and the CLI usage also mixes Chinese terms, which imposes a specific language on users without opt-in. This matches the language/locale policy violation category because no alternative language or user choice is provided.
This shell script emits user-facing content entirely in Chinese, including the usage string, generated markdown, JSON reason text, and checklist. Because the file provides no option to select another language or indicate that the skill is intentionally region-specific, it violates the language/locale policy criteria for forced language without user opt-in.
The generated publish-pack sets "autoUpload": true even though the skill is described as semi-automatic with final human confirmation. Uploading content before a human review can leak unintended, noncompliant, or sensitive media to the platform and undermines the safety boundary the documentation claims to preserve.
The script defines DOUBAO_API_KEY as the credential source and later uses it to call a remote image-generation API. While the script prints progress messages, it does not disclose that a credential will be read from the environment and used for an outbound network request.
The script sends user-supplied topic, audience, and optional image description content to a third-party remote API for prompt-based image generation without an explicit warning or consent step in the script. In this skill context, that data flow is expected for functionality, but it can still expose potentially sensitive business plans, campaign ideas, or personal data if users enter them unknowingly.
This markdown template is entirely written in Chinese and provides no indication that users may choose another language or that the skill is intentionally limited to a Chinese-language context. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy violation.
The remove_account flow can recursively delete a Chrome profile directory via shutil.rmtree(profile_dir) when --delete-profile is passed. Although the CLI help mentions the deletion option, the code performs the irreversible deletion without a confirmation prompt or explicit runtime warning at the point of action.
Request target host is built from a dynamic or untrusted value. If the host is attacker-influenced, this enables SSRF to arbitrary internal or metadata endpoints.
return pages[0]["webSocketDebuggerUrl"]
# Create a new tab
resp = requests.put(
f"http://{self.host}:{self.port}/json/new?{XHS_CREATOR_URL}",
timeout=5,
)
Like and collect/bookmark automation are unrelated to the advertised publishing workflow and introduce additional engagement-manipulation actions on the user's account. Even if not wired into the main CLI path here, retaining latent action primitives in a skill broadens misuse potential and undermines operator trust about what the tool can do.
The comment-posting path performs a live external account action immediately after content is provided, with no confirmation, preview, or warning. In an agent context this can generate unsolicited interactions, spam, reputational harm, or policy violations on behalf of the logged-in user.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f" profile dir: {user_data_dir}")
print(f" debug port : {port}")
proc = subprocess.Popen(
cmd,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
No suspicious patterns detected.