T09 · Insecure Skill Coding Practices
- Location
scripts/collect_agent_skills.py:352- Finding
Spreadsheet Formula Injection Through Untrusted Skill Metadata
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a legitimate SkillHub collection/export tool, but it needs Review because it writes untrusted remote metadata into Excel without formula neutralization and has under-disclosed external data flows and mutable installs.
Install only if you are comfortable with the tool contacting SkillHub, cn.clawhub-mirror.com, and a third-party translation service. Open generated workbooks with external content and automatic link updates disabled, and prefer a project-local install with pinned dependency versions before using it in a sensitive environment.
scripts/collect_agent_skills.py:352Spreadsheet Formula Injection Through Untrusted Skill Metadata
SKILL.md:14Unpinned Third-Party and Globally Installed Dependencies
The skill invokes shell commands and performs network-backed searches via the SkillHub CLI, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates a least-privilege and governance gap: a host agent may grant broader shell/network access than intended, making misuse, unexpected outbound requests, or unsafe command execution harder to control and audit.
The description is written as a directive that the skill will search and export using Chinese-oriented behavior, and later notes explicitly prefer Chinese summaries. This imposes a language/locale choice without stating that users may choose another language or that the skill is region-specific.
The note to prioritize the summary field specifically because it is a Chinese description establishes a language preference in the skill instructions. There is no indication that users can opt into another language or that the Chinese-only preference is required for a documented regional purpose.
The skill metadata says collection is from SkillHub, but the code also pulls data from cn.clawhub-mirror.com and from an external translation service. This undisclosed third-party data flow creates a transparency and supply-chain risk because users may believe they are interacting with one source while the script sends and receives data from additional domains.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def search_skills(query, limit=15):
"""使用 skillhub CLI 搜索"""
try:
result = subprocess.run(
['skillhub', 'search', query, '--search-limit', str(limit), '--json'],
capture_output=True, text=True, timeout=20
)
The script sends skill descriptions to api.mymemory.translated.net for translation, which is outside the core stated purpose of collecting and exporting skills. Even if the text is not highly sensitive, this is an unnecessary external transmission of fetched content and may violate user expectations, internal policy, or data-handling requirements.
The code transmits description text to a third-party translation API without any user-facing notice, consent, or configuration gate. Lack of disclosure increases privacy and compliance risk because users cannot assess whether fetched content is permitted to leave their environment.
This line performs an external HTTP request to a third-party translation service containing skill description text in the query string. Query-string transmission is especially visible in logs, proxies, and browser-like telemetry, making data exposure more likely and increasing the privacy/compliance impact of the undisclosed outbound request.
try:
import urllib.parse
encoded_text = urllib.parse.quote(text[:500])
url = f"https://api.mymemory.translated.net/get?q={encoded_text}&langpair=en|zh"
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
with urllib.request.urlopen(req, timeout=10) as response:
result = json.loads(response.read().decode('utf-8'))
The code explicitly forces descriptions into Chinese (强制中文描述) and automatically translates non-Chinese text, but provides no user opt-in or locale selection. This is a natural-language policy concern because it hard-codes a specific language behavior instead of letting the user choose.
The dependency manifest leaves openpyxl unpinned, which makes builds non-reproducible and can result in installation of unexpected or vulnerable versions over time. In a skill that exports data to Excel, this package is likely core functionality, so consuming an outdated or newly introduced vulnerable release could expose the system to known parser or XML-related issues.
openpyxl
requests
The manifest does not specify which openpyxl version will be installed, so it is impossible to verify whether the environment avoids versions affected by known XXE-related advisories. Given this skill exports Excel content, use of a vulnerable openpyxl release could become relevant if the package processes attacker-controlled workbook or XML content anywhere in the workflow.
The requests dependency is unpinned, so installations may resolve to different versions in different environments, including versions with known security defects. Because this skill performs real-time collection from an external site, the HTTP client is security-relevant and version drift can affect transport security, credential handling, and request processing behavior.
openpyxl
requests
Because requests is not version-pinned, the deployed package may be an affected release with any of multiple known advisories, and the manifest provides no assurance that a safe version will be used. This skill makes network requests to an external service, so a vulnerable HTTP client could have practical security consequences depending on runtime behavior such as redirects, URL handling, TLS verification, or credential lookup.