T09 · Insecure Skill Coding Practices
- Location
scripts/kongfz_search_xbrowser.py:55- Finding
Unescaped User Input in xbrowser Batch Command
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mainly an auction-search helper, but it uses shell-launched browser automation with weak input handling and imprecise installation guidance, so users should review it before installing.
Install only if you are comfortable with it automating Kongfz pages through xbrowser. Prefer an isolated, logged-out browser profile, pin the installer and repository source, and restrict or escape keyword input before using the included script.
scripts/kongfz_search_xbrowser.py:55Unescaped User Input in xbrowser Batch Command
README.md:55Unpinned Third-Party Installation Through npx
代码的核心功能仍然属于孔夫子网拍卖检索,访问资源也与声明基本一致,因此不是完全不同的技能。但声明中最关键的行为是“自动搜索安康、来鹿堂、兴安府三个关键词相关文献拍品”,而代码并没有依次搜索这三个关键词,也没有内置组合检索逻辑;它只接受一个 --keyword 参数并执行一次搜索,默认值还是“安康文字”。此外,--region 参数仅打印未实际用于筛选。故描述对实际行为有明显夸大和偏差,应判定为不匹配。
The entire skill description is presented only in Chinese, with no indication that users may interact in other languages or that the language restriction is intentional and required. Under the policy, language or locale constraints should either provide user opt-in/choice or be clearly documented and justified as region-specific.
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 skill instructs the agent to execute shell commands (node ... xb.cjs, python ...) but does not declare any permissions or allowed-tools scope. This creates an implicit capability escalation risk: a caller may trigger shell-backed automation without an explicit least-privilege boundary or user-visible approval model.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""运行 xb 命令并返回 JSON 结果"""
cmd = ["node", XB_PATH] + args
print(f"[CMD] {' '.join(cmd)}", flush=True)
result = subprocess.run(cmd, capture_output=True, text=True, timeout=120, encoding='utf-8')
output = result.stdout.strip()
# xb batch 输出是一个大的 JSON 对象
The manifest describes a narrowly scoped skill that automatically searches for literature auction items related to the three keywords 安康、来鹿堂、兴安府. In code, the CLI accepts an arbitrary --keyword argument and passes it directly into the browser automation, with a default of only 安康文字, so the implemented behavior is broader and different from the stated fixed-keyword scope.
The description says the skill will automatically search three distinct keywords, implying multi-keyword coverage in one invocation. The implementation parses only one --keyword value and calls search_auction once, so it does not automatically search all three declared terms.
The script exposes a --region parameter and prints '地区筛选', which implies region-based filtering as part of the search behavior. However, the value is never incorporated into the xbrowser commands or parsing logic, so actual behavior does not match the implied functionality.