T09 · Insecure Skill Coding Practices
- Location
scripts/_client.py:27- Finding
API Token and Document Data Can Be Transmitted to an Arbitrary Configured Server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its Yuque management purpose, but it stores a Yuque token in plaintext, can send that token and document data to a configurable server, and includes destructive actions without built-in confirmations.
Install only if you are comfortable granting an agent access to your Yuque account. Prefer using the YUQUE_TOKEN environment variable instead of config.json, keep any token narrowly scoped if Yuque supports that, verify base_url remains https://www.yuque.com, and require manual confirmation before deleting documents, changing visibility, or reorganizing TOC nodes.
scripts/_client.py:27API Token and Document Data Can Be Transmitted to an Arbitrary Configured Server
scripts/_client.py:15Long-Lived Yuque API Token Is Stored in a Plaintext Project Configuration File
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### How to get your API Token
1. Login to [Yuque](https://www.yuque.com)
2. Click Avatar → Settings (设置) → Developer (开发者) → Personal Access Token (个人访问令牌)
3. Create a new token, copy it
## Setup Details
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
#### PUT /api/v2/repos/{book_id}/docs/{id}
Update a document. Same fields as create, all optional.
#### DELETE /api/v2/repos/{book_id}/docs/{id}
Delete a document.
---
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
#### PUT /api/v2/repos/{book_id}
Update repo. Fields: `name`, `slug`, `description`, `public`, `toc` (markdown format).
#### DELETE /api/v2/repos/{book_id}
Delete a repo.
---
The skill exposes capabilities that can access environment variables, read local files, and make network requests, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this increases the chance of over-broad execution, unintended data access, or silent exfiltration because the agent may use more privileges than the user expects.
The instructions tell the agent to place a Yuque API token into config.json, creating a plaintext local credential file without any warning about file permissions, accidental commits, or workspace exposure. In shared repos or agent-accessible directories, this can lead to credential theft and unauthorized access to the user's Yuque account and content.
The skill documents a delete_doc.py capability but provides no warning, confirmation step, or safeguard for destructive actions. In agent workflows, this can cause irreversible document deletion from ambiguous prompts, operator mistakes, or prompt injection that tricks the agent into invoking deletion.
The reorganization workflow includes removeNode actions that can alter or remove the visible knowledge-base structure without warning about the consequences. Even if content is not fully deleted, structural changes can hide documents, break navigation, and cause significant operational disruption when executed by an autonomous agent.
This markdown API reference includes DELETE endpoints for documents and repositories and update operations that can modify user content, but it provides no warning about their destructive effect or the need for caution. Under the markdown-file criteria, descriptions should warn about behaviors that may affect user data or system integrity.
This script sends arbitrary document content to Yuque and can optionally set visibility to public or org-public without any explicit user-facing confirmation or warning at the point of transmission. In an agent skill context, that increases the risk of accidental exfiltration of sensitive data or unintended publication if upstream tooling passes private content or sets --public automatically.
The script performs an irreversible DELETE request against a Yuque document immediately after parsing CLI arguments, with no confirmation prompt, dry-run mode, or guardrail to verify the target. In an agent skill context, this increases the chance of accidental or mis-targeted deletion from user misunderstanding, prompt injection into parameters, or automation mistakes, leading to data loss.