Back to skill

Security audit

Cue 搭子

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly coherent Cue template-authoring skill, but it needs review because it can change your Cue account and update/check its own files with some controls enforced only by agent instructions.

Install only if you are comfortable giving the skill access to your Cue API key, cuecue.cn network calls, selected local reference files, and a local ~/.cue-style runtime directory. Treat create/update/frequent/unfrequent as real account changes, confirm every mutation yourself, and avoid +upgrade or the session-start silent update check unless you accept GitHub-based self-maintenance.

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/cue_api.py:1167
Finding

State-Changing API Commands Do Not Enforce User Confirmation

Content
View full analysis

Vulnerability Details

File Location: scripts/cue_api.py:1167-1208
Vulnerability Type: Missing executable authorization gate for persistent account mutations
Risk Level: Medium

Vulnerable Code

python
if cmd in ("frequent", "unfrequent"):
    if len(sys.argv) < 3:
        print("usage: cue_api.py {frequent|unfrequent} <template_id>")
        return 2
    _bad = validate_template_id(sys.argv[2])
    if _bad:
        print(f"[cue_api] ✗ {_bad}")
        return 2
    res = set_template_frequent(
        sys.argv[2],
        is_frequent=(cmd == "frequent"),
    )
    print(json.dumps(res, ensure_ascii=False, indent=2))
    return 0

if cmd == "create":
    if len(sys.argv) < 3:
        print("usage: cue_api.py create <payload.json>")
        print(
            "  payload must include: source_conversation_id "
            "+ the 4 LLM fields"
        )
        return 2
    payload_path = sys.argv[2]
    payload = json.loads(
        Path(payload_path).read_text(encoding="utf-8")
    )
    if not payload.get("source_conversation_id"):
        sys.stderr.write(
            "[create] payload missing source_conversation_id; "
            "use 'seed:<slug>:v1' for synthetic\n"
        )
        return 2
    res = create_template(payload)
    tid = res.get("template_id") or res.get("id") or "?"
    print(f"[create] created template_id={tid}")
    print(json.dumps(res, ensure_ascii=False, indent=2))
    return 0

if cmd == "update":
    if len(sys.argv) < 4:
        print(
            "usage: cue_api.py update "
            "<template_id> <payload.json>"
        )
        print(
            "  payload may include any subset of "
            "the 4 LLM fields + meta"
        )
        return 2
    template_id = sys.argv[2]
    _bad = validate_template_id(template_id)
    if _bad:
        print(f"[cue_api] ✗ {_bad}")
        return 2
    payload_path = sys.argv[3]
    payload = json.loads(
        Path(payload_pa
...[truncated 2858 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a default-deny interactive confirmation prompt to every state-changing CLI command:

    • create
    • update
    • frequent
    • unfrequent
  2. Require the user to confirm the exact target and operation. Before approval, display:

    • The operation name.
    • The target template ID, if applicable.
    • A concise payload summary.
    • A field-level diff for updates.
  3. Support noninteractive automation only through an explicit --yes flag. The agent should supply this flag only after obtaining the user's approval in the current interaction.

  4. Create a restorable local backup before direct updates, using the same safe backup mechanism provided by tune_template.py.

  5. Consider separating read-only and mutating subcommands so callers can be granted only the capabilities required for a task.

  6. Add regression tests verifying that each mutating command:

    • Refuses execution by default when no confirmation is available.
    • Performs no network mutation after cancellation.
    • Executes only after valid interactive confirmation or an explicit --yes flag.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (75)

Tainted flow: 'req' from os.environ.get (line 1014, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cue_api.py (reported line 223)May include surrounding context.

python
if stream:
        req.add_header("Accept", "text/event-stream")
    try:
        resp = urllib.request.urlopen(req, timeout=timeout)
    except urllib.error.HTTPError as e:
        # 4xx/5xx — server replied with HTTP error. Decode body for actionable detail.
        try:

Tainted flow: 'req' from os.environ.get (line 1014, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cue_api.py (reported line 678)May include surrounding context.

python
if stream:
        req.add_header("Accept", "text/event-stream")
    try:
        resp = urllib.request.urlopen(req, timeout=timeout)
    except urllib.error.HTTPError as e:
        # 4xx/5xx — server replied with HTTP error. Decode body for actionable detail.
        try:

Tainted flow: 'req' from os.environ.get (line 1014, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cue_api.py (reported line 935)May include surrounding context.

python
if stream:
        req.add_header("Accept", "text/event-stream")
    try:
        resp = urllib.request.urlopen(req, timeout=timeout)
    except urllib.error.HTTPError as e:
        # 4xx/5xx — server replied with HTTP error. Decode body for actionable detail.
        try:

Tainted flow: 'req' from os.environ.get (line 1014, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cue_api.py (reported line 1019)May include surrounding context.

python
if stream:
        req.add_header("Accept", "text/event-stream")
    try:
        resp = urllib.request.urlopen(req, timeout=timeout)
    except urllib.error.HTTPError as e:
        # 4xx/5xx — server replied with HTTP error. Decode body for actionable detail.
        try:

Tainted flow: 'req' from os.environ.get (line 1014, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cue_api.py (reported line 760)May include surrounding context.

python
req.add_header("Content-Type", "application/json")
    req.add_header("device_type", device_type)
    try:
        resp = urllib.request.urlopen(req, timeout=60)
    except urllib.error.HTTPError as e:
        try:
            err_body = e.read().decode("utf-8", errors="replace")

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a public-data template-authoring assistant but also includes a self-update path that fetches remote content and may run local git pull. This expands the trust boundary from Cue APIs to arbitrary future repository state, creating a supply-chain and unexpected code-modification risk for users who did not opt into code maintenance behavior.

Content

No source excerpt is available for this finding.

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · scripts/cue_api.py (reported line 419)May include surrounding context.

python
``task_configs`` is present without ``schedules``, derive
       ``schedules`` from it. Each item must carry ``type`` + ``time``
       (backend ScheduleConfig marks them required); items missing
       either raise — silently sending None would 422 from server.
    3. **Strip server-internal keys**: outbound payload must not carry
       ``task_cron_expressions`` / ``task_configs`` (DB-column shape,
       not API contract).

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/test_skill_regression.py (reported line 881)May include surrounding context.

python
subprocess.run(
                ["git", "-C", str(tmp_p), "checkout", "-q", sha],
                check=True,
                env={**os.environ, "GIT_AUTHOR_NAME": "T", "GIT_AUTHOR_EMAIL": "t@t"},
            )
            self.assertIsNone(git_current_branch(tmp_p))

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 54)May include surrounding context.

md
## Who this is for

- **Domain experts**: finance / banking credit / asset management / private fund DD / regulatory compliance / corporate-strategy research / industry analyst
- Knows their scenario deeply but does not write Python and does not read API specs
- Has a Cue account (sign up at [cuecue.cn](https://cuecue.cn) — new users get a one-time **500 credits**, plus **10 free credits every day**)
- Has an API key (create one at [cuecue.cn/hub/api-key](https://cuecue.cn/hub/api-key))

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares powerful capabilities (environment access, file read/write, network, and shell execution) without an explicit permission boundary in the manifest. This increases the chance that a host agent grants broader access than users expect, especially because the document also instructs local script execution and remote API usage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Documenting a self-upgrade feature that checks GitHub and performs local git operations is a meaningful scope expansion beyond public-data template authoring. If triggered unintentionally or in a compromised repository context, it can modify local code and introduce supply-chain risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The skill recommends a session-start silent check that writes cooldown state to ~/.cue/last-update-check.json, introducing persistence across sessions without strong user-facing disclosure or necessity for the core authoring workflow. Persistent local state can be abused for tracking behavior, creating hidden side effects, or normalizing background maintenance activity in a tool that otherwise appears task-focused.

Content

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

md
| `+unfrequent <template_id>` | 取消"常用",从首页"常用"区移除 | 否 | `POST /api/templates/frequent` (`is_frequent=false`) |
| `+upgrade` | 检查并(经确认后)升级 skill 自身到 GitHub `main` 最新版。git clone 装的走 `git pull --ff-only`,copy 装的给手动指引;本地有未提交改动则 abort 不强覆盖。**注意:跟 `+update <template_id>`(改模板)语义完全不同** | 否 | (GitHub raw + `git pull`,**本地操作**) |

**全部已上线 verb**:`+author / +capabilities / +validate / +create / +list / +get / +update / +test / +tune / +frequent / +unfrequent / +upgrade`。

**`+upgrade` 与 session 启动 silent-check**:agent 加载本 SKILL.md 时,**建议**在跑任何 verb 前先 silent 跑一次:`python3 cue-buddy/scripts/update_skill.py --silent-check`。这是带 24h 冷却的轻量版本对比,落后时只在 stderr 打一行 `ℹ️ cue-skills/cue-buddy 有新版可用 vX → vY,运行 +upgrade 升级`,**不弹问、不阻塞、不自动 pull**。网络失败时静默跳过(下次再试)。冷却 timestamp 存 `~/.cue/last-update-check.json`。

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Overly broad trigger phrases can cause accidental invocation of high-privilege or state-changing workflows when the user is speaking conversationally. In this skill, accidental activation matters because some verbs read local files, perform network access, write state, or later lead to credit-consuming and repository-modifying actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Generic update triggers are dangerous because they may collide with ordinary requests to "update" something, yet the corresponding actions can modify stored templates or initiate maintenance behavior. Ambiguity around update semantics is particularly risky here because the skill defines both +update and +upgrade, with one changing remote/user state and the other potentially altering local code.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Using a generic trigger like "调优" for a credit-consuming action creates risk of unintended paid execution. Because +tune also changes template content after generation, accidental invocation can incur cost and produce undesired state changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to read arbitrary local files and fetch arbitrary URLs as source material, which can pull sensitive local content or untrusted remote content into the model context. Even though the text says not to upload materials to the remote API, secret exposure can still occur inside the agent session or through later prompt contamination and accidental inclusion in payloads.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · docs/verification-reports/2026-05-20-gemini-cli.md (reported line 65)May include surrounding context.

md
- **Rotate the Cue API key** at `https://cuecue.cn/hub/api-key` after any cross-agent session that involved pasting the key into chat (Gemini CLI / Codex / OpenClaw all persist chat history to disk by default).
- Treat `~/.gemini/tmp/` and equivalent dirs as containing secrets — never commit them, never share, never sync to public cloud.
- Use `export CUE_API_KEY=sk-...` in shell env or write to `~/.cue/config.json` (mode 600) so the key never enters chat content.

## References

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents its rules entirely in Chinese and the title explicitly pairs an English label with a Chinese-only formulation, with no indication that other languages are supported. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
82% confidence
Finding

The file discloses an internal repository-style path (~/work/buddy/skills/developing-buddies/SKILL.md) and references internal validation/create/update workflow commands. While not immediately exploitable on its own, this leaks implementation and environment details that can help an attacker map the skill-development structure, infer backend process names, and craft more targeted social-engineering or prompt-injection attempts against maintainers.

Content

Scanner excerpt · references/hard-rules.md (reported line 5)May include surrounding context.

md
R1-R7 + R9 均有 `+validate` 自动检测,违反 `error` 级会拒绝 `+create / +update`,`warning` 级允许通过但强烈建议改。R8 不是铁律,是设计经验法则——见末尾 [设计经验法则](#design-heuristics) 章节,跟 R1-R9 hard rules 分开,**不**走 validator。

本文是 `~/work/buddy/skills/developing-buddies/SKILL.md` 的公开发布版(脱去内部基础设施引用)。

---

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document consistently instructs agent behavior in Chinese and does not indicate that users may choose another language or that the skill is restricted to a Chinese-speaking or region-specific context. Under the policy rule for language or locale constraints, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.