T08 · Insecure Dependencies
- Location
scripts/logistics_checker.py:19- Finding
Automatic Installation of an Unpinned Dependency from a Third-Party Mirror
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a real logistics/SMS workflow, but it needs review because it can auto-install code, process and store customer data, and send bulk SMS without the documented confirmation step.
Review this skill before installing. Use dry-run first, avoid running it where automatic package installation can occur, keep SMS credentials in a protected secret store or environment, and do not use send mode until recipients and message text have been separately reviewed. Treat generated JSON and HTML reports as sensitive customer data.
scripts/logistics_checker.py:19Automatic Installation of an Unpinned Dependency from a Third-Party Mirror
scripts/sms_sender.py:276Stored HTML Injection in Generated Logistics and SMS Reports
scripts/logistics_checker.py:389Plaintext Persistence of Customer Personal and Logistics Data
scripts/order_processor.py:120Documented Pre-Send Confirmation Is Not Implemented
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
url = f"{UAPI_BASE_URL}?{urlencode(params)}"
resp = requests.get(url, headers=headers, timeout=15)
if resp.status_code == 200:
data = resp.json()
代码与描述部分匹配于“物流查询+延迟检测”这一子集:支持CSV读取、单号查询、UAPI物流轨迹查询,以及发货超时/运输停滞/派送异常/预计超时/无物流信息等规则检测。但描述中的关键后半部分能力——AI生成安抚话术、短信发送给客户、云短信通道集成、dry-run预览——在代码中完全缺失。现有 --validate 只是校验CSV格式,不是发送前预览。因此该技能的声明明显超出了代码实际行为,属于描述与实现不一致。
The declared description presents a broader end-to-end logistics delay detection skill: ingesting order data (CSV/manual waybill input), querying shipment tracking, detecting multiple delay conditions, generating AI reassurance copy, and sending SMS. The supplied code only implements the downstream messaging/reporting portion. It reads an input JSON file that is explicitly described as output from a separate logistics checker, uses templates/rules to generate SMS text, optionally sends via Alibaba or Tencent SMS SDKs, and generates an HTML preview. There is no code for CSV parsing, manual waybill entry, external logistics API querying, or actual delay detection from raw tracking events in this chunk. Because key declared capabilities are absent and the actual code is narrower than the declared end-to-end behavior, this is a description-behavior mismatch.
The script reads sensitive configuration from environment variables (UAPI_API_KEY) but the finding indicates this capability is not declared in permissions metadata. Undeclared access to environment secrets weakens sandboxing and user trust because the skill can consume credentials without transparent permission coverage.
The script executes a shell command to install dependencies automatically when requests is missing. Even though the interpolated executable path is not directly user-controlled here, invoking os.system() for package installation expands the attack surface, can execute unexpected code during install, and performs side effects without explicit user approval.
import requests
except ImportError:
print("[SETUP] 安装依赖: pip install requests")
os.system(f"{sys.executable} -m pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn")
import requests
# ============ 配置 ============
The trigger list is broad enough that normal logistics- or delivery-related conversation could invoke the skill unexpectedly. Because the skill is designed to process order data, query external services, and potentially send customer-facing SMS, accidental activation increases the risk of unintended data handling or downstream actions.
The skill handles sensitive customer data such as names, phone numbers, tracking numbers, and order details, and it contemplates bulk outbound SMS. Without explicit warnings, consent expectations, data-handling guidance, and operational safeguards, users may process personal data improperly or send messages in violation of privacy, telecom, or anti-spam requirements.
The document instructs users to configure third-party SMS providers and pass full message content through templated variables, but it does not warn that customer names, order IDs, tracking numbers, phone numbers, and delay details may be disclosed to external vendors. In this logistics-care context, those fields are likely to contain personal and transactional data, creating privacy, compliance, and data-sharing risks if operators are not explicitly guided to minimize and protect transmitted content.
The JSON configuration example encourages storing cloud access credentials in a local file without any warning about filesystem permissions, exclusion from version control, or secret-management practices. If copied into a repo, shared workspace, backup, or support bundle, these secrets could be exposed and allow unauthorized use of the SMS account, message fraud, billing abuse, or broader cloud compromise depending on account scope.
The Tencent Cloud credential example similarly presents persistent storage of secret_id and secret_key in JSON without secure-handling warnings. In a skill designed for operational messaging, these credentials could be attractive targets because compromise enables unauthorized SMS sending, cost abuse, impersonation of the business, and potential access to related cloud resources.
The skill auto-installs a Python package at runtime via a shell command, which is unrelated to its core logistics-checking function and introduces supply-chain and execution risk. A network-retrieved package can run arbitrary install-time code, and the user may not expect the script to modify the environment.
The script installs dependencies automatically without explicit user confirmation, causing unexpected code execution and environment modification. In a skill that processes customer logistics data, silent setup actions are particularly risky because users may run it in trusted automation contexts where side effects are not anticipated.
This file contains natural-language strings that force a specific language/locale for the skill experience, including the module docstring and CLI help text. Under the policy, language constraints should be optional or explicitly justified; here there is no opt-in or explanation that the skill is intended only for Chinese-speaking users.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f" {name}")
print(f"{'='*60}")
result = subprocess.run(cmd, capture_output=False, text=True)
if result.returncode != 0:
print(f"⚠️ 步骤失败 (exit code: {result.returncode})")
return False
脚本的自然语言内容、短信模板、HTML页面语言和手机号格式均固定为中文语境与中国大陆配置,如lang="zh-CN"和+86前缀,但没有提供语言或地区选择机制。按规则,这属于未获用户选择即强制特定语言/locale的策略问题。
In send mode, the skill transmits customer phone numbers and personalized message contents to Alibaba Cloud or Tencent Cloud SMS APIs without presenting an explicit risk notice or consent checkpoint. Because the skill is specifically designed for bulk customer communications, this expands third-party data exposure and can create privacy, regulatory, and misuse risks if operators are unaware of the transfer scope.
The script writes an HTML preview report and a JSON result file containing customer names, order IDs, tracking numbers, phone numbers, and message content to disk without any warning, minimization, or access protection. In an e-commerce logistics context, these artifacts can expose personally identifiable information to other local users, backups, logs, or accidental sharing, increasing privacy and compliance risk.
The skill title and all user-facing instructions are written in Chinese, and the described output includes automatically generated SMS copy, implying a fixed language/locale experience. The file does not offer user opt-in for language selection or explain that the skill is intentionally limited to a Chinese-speaking or China-market context.
The file-level natural-language description is entirely in Chinese and presents the skill as operating in that language without any indication of user choice or opt-in. Under the policy, language constraints should either offer a language/locale choice or be explicitly justified as region-specific.
The top-level description and module docstring present the script as a logistics delay detection engine that queries tracking, applies rules, and outputs structured detection results. In practice, batch processing persists a JSON file containing customer names, phone numbers, tracking numbers, and tracking details, which is broader data handling than the narrow detection description suggests.
The module docstring at L004 and section comment at L074 describe AI or LLM-generated personalized messaging, implying model-driven generation. In practice, generate_message_ai at L076-L098 just selects a hardcoded template and formats variables, with no model invocation or external AI call.
No suspicious patterns detected.