T08 · Insecure Dependencies
- Location
scripts/customs_search.py:194- Finding
Unpinned Runtime Dependency Installation from Multiple Package Indexes
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a customs lookup skill, but it automates a WAF-protected government site, installs unpinned packages at runtime, uses plaintext HTTP, and caches results locally.
Install only if you are authorized to automate this customs lookup site and are comfortable with local package installation, Chrome automation, plaintext HTTP queries, and workspace CSV caching. Prefer running it in an isolated, least-privileged environment, pinning dependencies, disabling automatic mirror fallback, and validating important customs results through an official trusted source before using them for shipping decisions.
scripts/customs_search.py:194Unpinned Runtime Dependency Installation from Multiple Package Indexes
scripts/customs_search.py:26Unauthenticated Plaintext HTTP Transport for Customs Queries and Results
The script explicitly states it will bypass WAF protections, which is behavior aimed at defeating access controls rather than simply querying a public service. In skill context, that makes the automation materially more dangerous because it normalizes anti-protection evasion against a government system and may violate policy, trigger blocking, or facilitate unauthorized scraping.
The documentation disguises risky behavior as a normal customs filing lookup while openly describing WAF bypass, which is a strong indicator of adversarial or at least policy-evading design. That framing is dangerous because operators may approve the skill based on benign business wording without realizing it includes anti-defensive evasion behavior.
os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.
if not _is_in_venv():
venv_python = _get_venv_python()
if venv_python:
os.execv(venv_python, [venv_python] + sys.argv)
brand = args.brand.strip()
csv_path = args.cache_file or get_csv_path()
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
查询品牌,权利名称,权利人名称,权利人国别,权利号,备案号,权利类别,商品分类,备案状态,备案开始日期,备案截止日期,查询时间
TRW,TRW,TRW知识产权公司,美国,244497,T2016-50578,国内注册,第9类,生效,2026-02-28,2036-02-27,2026-05-25 18:45:37
TRW,TRW,TRW知识产权公司,美国,244496,T2016-50576,国内注册,第9类,生效,2026-02-28,2036-02-27,2026-05-25 18:45:37
TRW,TRW,TRW知识产权公司,美国,244607,T2016-50574,国内注册,第12类,生效,2026-02-28,2036-02-27,2026-05-25 18:45:37
The skill directs the agent to run shell commands, inspect environment state, and read/write a CSV cache, but it declares no explicit tool scope or permissions. That creates a least-privilege failure: an agent or runtime may grant broader capabilities than users expect, increasing the chance of unintended command execution, filesystem modification, or environment access.
The activation description lists broad phrases such as "品牌备案", "备案状态", and "品牌合规筛查" alongside the intended customs-IP query phrases. These terms are not specific to the customs filing system and could overlap with ordinary compliance or status-check requests, making unintended invocation more likely.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
if sys.platform == "win32":
# Windows 下用 where 命令,指定 encoding 避免 UTF-8 解码错误
result = subprocess.run(
["where", "chrome"],
capture_output=True, text=True, timeout=5,
encoding="gbk", errors="replace"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if os.path.isfile(path):
return path
else:
result = subprocess.run(
["which", "google-chrome"],
capture_output=True, text=True, timeout=5
)
The skill claims to perform a customs query, but it also creates virtual environments and installs dependencies, which are privileged side effects unrelated to the narrow business purpose. This mismatch increases risk because users and orchestrators may permit the skill expecting read-only query behavior, while it actually performs local environment mutation and network package retrieval.
Creating a virtual environment and later installing packages causes local filesystem and potentially network side effects that are not surfaced as an upfront warning in a supposedly query-only skill. This is dangerous because it breaks least surprise, expands the attack surface, and can violate execution-environment expectations or organizational controls.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if not os.path.isfile(venv_python):
print(json.dumps({"action": "create_venv", "path": venv_dir}))
subprocess.run(
[sys.executable, "-m", "venv", venv_dir],
capture_output=True, text=True, timeout=60
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
check_cmd = [sys.executable, "-c", "import nodriver"]
try:
r = subprocess.run(
check_cmd, capture_output=True, text=True, timeout=10,
encoding="gbk" if sys.platform == "win32" else "utf-8",
errors="replace"
The script automatically installs a package from PyPI or a mirror at runtime, creating a supply-chain and unexpected system/network modification risk. In an agent skill advertised as a query tool, silently fetching and executing third-party package installation is dangerous because a compromised package, mirror, or dependency chain can lead to arbitrary code execution in the skill environment.
print(json.dumps({"action": "install_deps", "mirror": mirror, "cmd": " ".join(pip_args)}))
try:
result = subprocess.run(pip_args, capture_output=True, text=True, timeout=120)
if result.returncode == 0:
return True
elif not mirror:
The script writes query results to a CSV cache automatically, potentially persisting sensitive business lookup history and rights-holder data without explicit user awareness. In an agent environment, silent file writes can create privacy, retention, and data-governance issues, especially when the workspace may be shared or later exfiltrated.
The module docstring, CLI descriptions, and user-facing messages are presented only in Chinese, with no indication that another language is available. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy issue.
No suspicious patterns detected.