Back to skill

Security audit

国内法规调研

Security checks across malware telemetry and agentic risk

Overview

The skill has a coherent legal-research purpose, but its command instructions can let untrusted query text run as shell code and it stores an API key without adequate protection guidance.

Review before installing. Only use this skill for queries you are comfortable sending to Cue, protect the Cue API key as a secret, and avoid running the documented shell command with raw user text; use an argument-array runner or another shell-free invocation method.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:93
Finding
Command Injection Through Unescaped User Query<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 93-97 **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```bash python3 ~/.cue/cue-skills/cue-research/scripts/research_run.py \ --query "<用户问题原话>" \ --template-id <运行时的搭子 template_id> \ --output ~/cue-reports/$(date +%Y-%m-%d-%H%M)-domestic-regulation.md ``` The parameter description at line 102 further instructs the agent to use the user's original query without rewriting it: ```markdown | `--query` | 用户原话,不要改写 | ``` ### Technical Analysis The Skill directs the agent to insert the user's original, untrusted query into a double-quoted shell argument. Double quotes do not suppress shell command substitution. Constructs such as `$(command)` and backticks are evaluated by the shell before `research_run.py` starts. Consequently, a query containing shell substitution syntax can cause arbitrary commands to run under the account executing the Skill. Quoting the argument with ordinary double quotes does not adequately sanitize it. ### Attack Path 1. An attacker supplies a legal-research query containing a shell expression, such as a `$(...)` substitution. 2. The Skill instructs the agent to preserve the query verbatim. 3. The agent substitutes that query into the documented shell command. 4. The shell evaluates the embedded substitution before launching Python. 5. The attacker's command executes with the privileges of the agent's local operating-system account. 6. The command can read accessible files, alter user data, extract the Cue API key, or download and execute additional payloads. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user running the agent. The attacker could access all files and credentials available to that account, modify or delete user data, steal `~/.cue/config.json`, tamper with local tools, and potentially establish persistence where the account has sufficien ...[truncated 178 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not construct a shell command by textual interpolation of the user query. - Launch the runner through an argument-array API that does not invoke a shell. For example, use Python's `subprocess.run()` with `shell=False` and one list element per argument. - Alternatively, pass the query through standard input or a securely created input file. - Treat the template ID as untrusted as well and validate it against the expected identifier format. - If shell execution is unavoidable, apply a proven argument-escaping mechanism such as Python's `shlex.quote()` to every dynamic argument. Prefer avoiding the shell entirely. - Add adversarial tests covering command substitutions, backticks, quotation marks, newlines, semicolons, redirections, and shell metacharacters. - Replace the instruction to insert the query into a shell command with an implementation that keeps user data and executable command syntax structurally separate. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:78
Finding
Cue API Key Written Without Explicitly Restrictive Permissions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 78-81 **Vulnerability Type**: Insecure credential storage **Risk Level**: Medium ### Vulnerable Code ```bash mkdir -p ~/.cue echo '{"api_key": "sk你的key"}' > ~/.cue/config.json ``` ### Technical Analysis The setup instructions write a bearer API credential to `~/.cue/config.json` without explicitly setting restrictive permissions on either the directory or the file. The resulting access mode depends on the user's current `umask` and any pre-existing directory permissions. In environments with permissive defaults, other local users may be able to traverse the directory and read the credential. Entering the complete command after replacing the placeholder can also expose the key through shell-history records. ### Attack Path 1. A user follows the setup instructions and substitutes a real Cue API key into the command. 2. The shell creates `~/.cue/config.json` using permissions derived from the ambient `umask`. 3. On a system with permissive home-directory and file permissions, another local user enumerates or reads the configuration file. 4. The attacker extracts the bearer credential. 5. The attacker authenticates to the Cue service as the victim and consumes available credits or accesses functions exposed to that account. This path requires local access and sufficiently permissive filesystem traversal permissions. ### Impact Assessment Exposure compromises the Cue API account associated with the key. An attacker could impersonate the user to the extent authorized by the API, consume paid or limited credits, and access any account-scoped functionality available through that credential. This issue does not directly provide operating-system privilege escalation. Its scope is primarily the external service account and any data or operations authorized by the exposed API key. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Create the configuration directory with owner-only permissions: ```bash install -d -m 700 "$HOME/.cue" ``` - Create the configuration file with mode `600`, for example by setting a restrictive `umask` before writing: ```bash umask 077 printf '%s\n' '{"api_key": "REPLACE_WITH_KEY"}' > "$HOME/.cue/config.json" chmod 600 "$HOME/.cue/config.json" ``` - Avoid putting the real API key directly into an interactive command that may be retained in shell history. Use a hidden prompt or a dedicated credential-management mechanism. - Prefer an operating-system keychain or secret store when supported. - Validate permissions before use and refuse to load the key if the file is readable by group or other users. - Document immediate key rotation if the file or shell history may have been exposed. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
88% confidence
Finding
The trigger list includes very broad legal/compliance terms such as '金融监管' and '法律法规查询', which can cause the skill to activate for ordinary legal discussion rather than explicit user intent to use this external service. In this context, unintended activation is more dangerous because the skill routes prompts to a third-party platform and may consume credits or transmit sensitive compliance-related queries off-platform.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs users to place a long-lived API key in a local plaintext file and then use it in Authorization headers to an external service, but does not clearly warn about credential sensitivity, local file exposure, shell history leakage, or transmission to a third party. Because this skill handles legal/compliance research, user queries may contain sensitive business or regulatory matters, making silent credential setup and external transmission riskier.

VirusTotal

64/64 vendors flagged this skill as clean.

View on VirusTotal

Static analysis

No suspicious patterns detected.