Back to skill

Security audit

Quake Search v1.0

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Quake CLI export helper, but it needs review because its documented API-key flow can expose the Quake credential in process listings or error logs.

Install only if you intend to run the Quake CLI locally and trust the Quake binary you provide. Prefer initializing the Quake key outside this wrapper, avoid `--key` on shared machines or CI systems, choose output paths deliberately, and rotate the API key if it may have appeared in logs or process telemetry.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/quake_batch_cli.py:85
Finding

Quake API Key Exposed Through Process Arguments and Error Messages

Content
View full analysis

Vulnerability Details

File Location: scripts/quake_batch_cli.py:85-93, 143-147, 270, 341-342, 431-432
Related Documentation: SKILL.md:23, 60, 63; scripts/README.md:25
Vulnerability Type: API credential exposure through command-line arguments and unredacted errors
Risk Level: Medium

Vulnerable Code

python
def run_quake(args: List[str], quake_bin: Optional[str] = None) -> str:
    exe = resolve_quake_binary(quake_bin)
    cmd = [str(exe)] + args
    proc = subprocess.run(
        cmd,
        cwd=str(script_dir()),
        capture_output=True,
        text=True,
        encoding="utf-8",
        errors="ignore",
    )
    output = (proc.stdout or "") + ("\n" + proc.stderr if proc.stderr else "")
    if proc.returncode != 0:
        raise QuakeCliError(f"命令失败: {' '.join(args)}\n{output.strip()}")
    return output
python
def init_key(api_key: str, quake_bin: Optional[str] = None) -> None:
    print("[*] 正在初始化 Quake key ...")
    out = run_quake(["init", api_key], quake_bin=quake_bin)
    print(out.strip() or "[+] init 完成")
python
parser.add_argument("--key", help="可选,若提供则先执行 quake init <key>")
python
if args.key:
    init_key(args.key, quake_bin=str(selected_bin))
python
except QuakeCliError as exc:
    print(f"[!] 错误: {exc}")
    raise SystemExit(1)

The documented usage also supplies the secret as a command-line argument:

bash
python3 scripts/quake_batch_cli.py --no-interactive --mode search --key "$QUAKE_API_KEY" --query 'app:"exchange 2010"' --fields "ip,port,title" --page-size 100 --max-records 1000 --output-csv search.csv --output-raw search_raw.txt

Technical Analysis

Although the documentation recommends storing the key in an environment variable, shell expansion of --key "$QUAKE_API_KEY" places the actual secret in the Python process's argument vector. The wrapper subsequently passes the key as an argument to the Quake child process via ["init", api_key].

Depending o ...[truncated 2166 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the --key command-line option for normal credential entry. Read the key directly from QUAKE_API_KEY inside the Python process or obtain it interactively with getpass.getpass() so it is not echoed.
  2. If the official Quake CLI supports reading credentials from standard input, a protected configuration file, or an environment variable, use that facility rather than invoking quake init &lt;key&gt;.
  3. If command-line transfer to the Quake executable is unavoidable, clearly document the residual process-list exposure and avoid encouraging initialization on shared systems.
  4. Redact sensitive arguments before constructing error messages. For example, represent an initialization failure as quake init [REDACTED] and never include the underlying secret.
  5. Avoid printing child-process output during credential initialization unless it is known not to echo the credential. Apply defensive redaction to both standard output and standard error.
  6. Update SKILL.md and scripts/README.md so examples do not use --key "$QUAKE_API_KEY".
  7. Add automated tests that force initialization failure and verify that neither the API key nor recognizable substrings of it appear in exceptions, standard output, or standard error.
  8. Rotate any API key that may already have appeared in process telemetry or logs, and remove retained log entries where feasible.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 21)May include surrounding context.

md
- 主脚本:`scripts/quake_batch_cli.py`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
- 主脚本:`scripts/quake_batch_cli.py`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

md
- 主脚本:`scripts/quake_batch_cli.py`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 60)May include surrounding context.

md
- 主脚本:`scripts/quake_batch_cli.py`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

md
- 主脚本:`scripts/quake_batch_cli.py`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises shell execution and file-writing behavior via its documented CLI workflow, but the manifest provides no explicit tool scope such as permissions or allowed-tools. That creates an authorization gap where an agent may invoke shell commands and write output files without clear least-privilege boundaries, increasing the chance of unintended command execution or filesystem impact.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation text uses broad trigger phrases like Quake, asset mapping, batch query, and auto-export, which can cause the skill to load for loosely related requests. Because this skill drives external binaries, accepts API keys, and exports data to files, over-broad activation increases the risk of unintended invocation and sensitive-data handling in contexts where the user did not clearly request this capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python skill presents errors, prompts, status messages, and CLI descriptions entirely in Chinese, such as the exception text, argparse help, and interactive prompts. Because the file does not offer any user opt-in for language selection or state that the tool is intentionally limited to a Chinese-speaking environment, it violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/quake_batch_cli.py (reported line 78)May include surrounding context.

python
def run_quake(args: List[str], quake_bin: Optional[str] = None) -> str:
    exe = resolve_quake_binary(quake_bin)
    cmd = [str(exe)] + args
    proc = subprocess.run(
        cmd,
        cwd=str(script_dir()),
        capture_output=True,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The user-facing documentation is written in Chinese throughout the skill description and usage instructions, with no indication that another language is available or that Chinese is required for a region-specific purpose. This can violate a language/locale policy when users are not given an opt-in or alternative.

Content

No source excerpt is available for this finding.