T01 · Skill Instruction Hijacking
- Location
stock-theme-events/scripts/get_stock_themes.py:31- Finding
Unvalidated User Input Is Embedded in an AI Subagent Task
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its stock-data purpose, but it needs Review because some helper paths can run mutable external tools and spawn under-scoped agents from user-controlled input.
Install only if you are comfortable with a stock-data skill that browses public financial sites, writes local report files, and invokes OpenClaw helpers. Prefer pinning package versions, removing the npx runtime fallback, running with a minimal environment that excludes secrets, validating stock codes before subagent calls, and avoiding the documented destructive cleanup/reset commands unless you have checked the target directory and repository state.
stock-theme-events/scripts/get_stock_themes.py:31Unvalidated User Input Is Embedded in an AI Subagent Task
cn-stock-volume/scripts/browser_fetch.py:42Unpinned Third-Party Package Execution Through an npx Fallback
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
Undeclared browser automation against external sites plus reading local cached data to construct additional outputs is security-relevant because it expands both data ingress and local data exposure beyond the stated skill purpose. In a skill intended as a reusable dependency, hidden enrichment from local caches or unofficial scraping can lead to unexpected data disclosure, brittle trust boundaries, and unsafe downstream assumptions.
rm -rf cache/* is a high-risk destructive command because it deletes all contents under the current cache directory without confirmation. In documentation for an agent skill, users or automation may execute it verbatim; if run from the wrong directory or after path confusion, it can cause unintended data loss beyond the intended cache cleanup.
# 清理所有缓存
rm -rf cache/*
# 清理特定日期的缓存
rm cache/2026-03-22.json
rm cache/2026-03-22.json is less dangerous than the recursive variant but still performs irreversible deletion and assumes the operator is in the correct directory. In an agent or copy-paste workflow, that assumption may fail, causing unintended file removal if a similarly named file exists elsewhere.
rm -rf cache/*
rm cache/2026-03-22.json
---
The code forwards the full parent process environment into an external executable, which can expose secrets such as API keys, tokens, and proxy credentials to that child process and any of its dependencies. In a skill context that invokes third-party tooling, this increases the blast radius if the CLI, Node runtime, or any package in that chain is compromised or overly verbose in logging.
for cmd in commands_to_try:
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
This line explicitly clones the entire process environment and passes it to an external command, creating a clear secret-exposure path to subprocesses. Because the skill is a data-fetching utility that depends on external browser tooling, inherited credentials are not necessary for its core function and therefore represent unnecessary risk.
capture_output=True,
text=True,
timeout=timeout_ms // 1000,
env={**os.environ, 'PATH': '/usr/local/bin:/usr/bin:/bin:' + os.environ.get('PATH', '')}
)
if result.returncode == 0:
Within the cn-stock-volume skill, this file's module description and code operate on three market indices (上证指数、深证成指、创业板指) rather than stock成交量 data. The final output also includes sentiment and volume sections with placeholder values, indicating behavior that does not match the subskill's stated volume-focused purpose.
This is a concrete example of tool parameter abuse: git reset --hard is a destructive command and the skill content presents it as a routine step. In the context of an agent skill or operational documentation, such commands are risky because users or downstream automation may execute them verbatim, causing loss of local work or unintended repository state changes.
git checkout -b temp-branch
git reset --hard origin/main
# HEAD 现在是 92b6742 fix: 整理 cn-stock-volume 目录结构
The install command uses npx clawhub@latest, which fetches and executes the most recent published package at runtime rather than a reviewed, fixed version. If the upstream package is compromised, typo-squatted, or a breaking release is published, users following the documentation could execute untrusted code on their machine.
This command again relies on npx clawhub@latest, causing users to execute whatever version is current at install time. That creates a supply-chain risk window where a compromised or unexpected release could run arbitrary code during installation.
Using npx with an unpinned @latest package delegates trust to the current state of the npm registry instead of the audited state at publish time. In a skill-installation context, this is especially risky because users are explicitly encouraged to copy-paste and execute the command.
The final install example repeats the same mutable dependency execution pattern. Because this is distribution documentation for install commands, the issue is operationally significant: end users may directly run these commands without additional validation.
The README is written entirely in Chinese, including usage instructions, cautions, and examples, with no indication that the skill is China-region-specific or that another language is available. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.
The skill declares required binaries/tools and explicitly instructs users to run Python scripts and use a browser, but it does not define any tool scope, permissions, or allowed-tools boundaries. In a skill framework, this increases the risk of over-broad execution because consumers cannot tell what network, shell, filesystem, or environment access is intended or should be restricted.
This markdown file presents all instructions, examples, and usage guidance only in Chinese, which can amount to forcing a specific language without user opt-in. The policy allows locale constraints when they are explicitly documented and justified, but this file does not state that the skill is China-specific or that Chinese output/instructions are required.
The documentation includes destructive cache-deletion commands that remove files without any adjacent warning about irreversible data loss or scope validation. In an agent skill context, example commands are often copied verbatim, so normalizing rm -rf use increases the chance of accidental deletion if the working directory is wrong or paths are modified.
This markdown file includes a command to clear previously supplemented data, which is a destructive operation affecting stored user data. The surrounding documentation does not provide any warning, confirmation note, or caution about deletion behavior, so users may invoke it without realizing it removes existing data.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
for cmd in commands_to_try:
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if target_id:
cmd.extend(['--target-id', target_id])
result = subprocess.run(
cmd,
capture_output=True,
text=True,
The module docstring explicitly says cache logic has been removed and each run will fetch the latest data. However, fetch_index_data later checks a local cache file and returns cached index data when present, which directly contradicts that documented intent.