T09 · Insecure Skill Coding Practices
- Location
scripts/knowledge-updater.sh:30- Finding
Arbitrary Python Code Execution Through a Crafted FAQ Filename
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a simple Chinese customer-service bot, but its scripts expose an unauthenticated network service and contain unsafe FAQ import handling, so it should be reviewed before installation.
Install only after reviewing the scripts. Keep the service bound to localhost unless you add authentication and production hardening, do not run it as root, avoid importing files with untrusted names, use pinned dependencies in a virtual environment, and add explicit privacy/retention rules before using real customer data.
scripts/knowledge-updater.sh:30Arbitrary Python Code Execution Through a Crafted FAQ Filename
scripts/chatbot-server.sh:7Predictable Shared Temporary Files Permit Symlink and PID-File Attacks
scripts/chatbot-server.sh:29Unauthenticated Chatbot Service Binds to All Network Interfaces
SKILL.md:94Unpinned Third-Party Dependency Installation Instructions
描述中的一部分与代码相符:它确实是一个自动客服服务,并支持启动、停止、测试、状态查看,以及简单的转人工判断。但核心能力描述明显高于实际实现。代码没有真正的知识库检索/匹配机制,FAQ 内容被读入后未参与回复;没有会话上下文或状态存储,因此不支持多轮对话管理;所谓意图识别只是少量关键词命中,不足以对应通常意义上的意图识别与分类。此外,reload 被描述为重载知识库,但服务端未实现 HUP 处理,实际很可能不能生效。因此描述不能准确代表该代码的真实能力,存在实质性不匹配。
The description presents this skill as an operational automated customer service system with conversational capabilities and service-management functions. The supplied code only provides offline FAQ knowledge-base maintenance: importing entries from Excel/CSV/Markdown into a markdown file, exporting that file, and backing it up. While FAQ knowledge-base configuration is one subset mentioned in the description, the implemented behavior is much narrower than the declared primary purpose and lacks the core chatbot/runtime capabilities. Therefore the description does not accurately represent what this code chunk actually does.
The skill describes listening to customer channels, logging conversations, and calling real-time APIs, but provides no privacy notice, consent model, retention guidance, or handling rules for personal data. In a customer-service setting this can expose sensitive account, complaint, and transactional data, creating material privacy, compliance, and data-governance risk.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
fi
echo "测试问题: $message"
response=$(curl -s -X POST "http://localhost:$SERVER_PORT/chat" \
-H "Content-Type: application/json" \
-d "{\"message\": \"$message\"}")
The skill instructs use of file reads/writes and shell scripts to start/stop/reload services and import/export data, but it does not declare any explicit tool scope or permissions boundary. That creates an authorization and review gap: an agent or operator may execute filesystem and shell-capable actions without the skill clearly constraining what paths, commands, or environments are allowed.
整个技能名称、描述和操作说明均固定为中文,未说明是否仅适用于中文客服场景,也未给出语言选择或用户 opt-in。按照语言/locale 政策,若技能限制特定语言,应明确提供选择机制或说明其地域/业务场景限定。
Overly broad trigger terms like common customer-service words can cause the skill to activate in unrelated conversations. In this skill's context, accidental invocation is more dangerous because the documented behavior includes reading reference files, handling customer data, and performing operational shell actions such as service management.
The documentation instructs operators to start, stop, reload services and import/export the knowledge base without warning about service interruption, stale state, data overwrite, or leakage risks. In practice, these actions can affect production availability and may expose or corrupt customer-support content if run casually or in the wrong environment.
The entire FAQ knowledge base is written only in Chinese and is structured as ready-made user-facing answers, which implicitly constrains the skill to respond in Chinese. There is no indication that users may choose another language or that the Chinese-only scope is a documented, justified regional limitation.
This markdown file defines all intent rules, examples, and handling guidance exclusively in Chinese. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified.
The entire response template library is written as fixed Chinese customer-service phrasing, and there is no indication that language selection is optional or limited to a China-specific deployment. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.
The shell script advertises reload as '重新加载知识库(不重启服务)' and implements it by sending HUP to the server PID. However, the embedded Flask server loads faq_content once at startup and defines no signal handler or code path to refresh that data, so the documented behavior contradicts the actual implementation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
echo "测试问题: $message"
response=$(curl -s -X POST "http://localhost:$SERVER_PORT/chat" \
-H "Content-Type: application/json" \
-d "{\"message\": \"$message\"}")
This shell script presents its purpose, usage, errors, and status messages only in Chinese, including the help output and operational prompts. That imposes a fixed language/locale on all users without opt-in, which matches the policy category for language or locale violations.
The file presents its purpose and all user-facing output in Chinese, indicating the skill is effectively restricted to a single language. The policy for this category says to flag language or locale constraints when they are forced without user opt-in or clear justified regional scope.
The code takes the provided message and posts it to the chatbot endpoint with curl, which is a network transmission of user data. Although the script logs that it is testing a question, it does not disclose that the message will be sent over HTTP to a running service or provide any warning about handling potentially sensitive content.