Back to skill

Security audit

Report Number Audit(数鉴-报告审计)

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this skill suspicious because scanners report serious audit and data-handling weaknesses, while two referenced files were only partially analyzed.

Consider the Review verdict before installing. If you need this skill, review its behavior and permissions with someone you trust, especially its handling of SQL, project-configured modules, source databases, and exported spreadsheets. Two referenced files were only partially analyzed, and dependency versions could not be verified.

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
scripts/rla_audit.py
Finding

Third-party ledger SQL executes with unrestricted filesystem capabilities

Content
View full analysis

Impact

A crafted ledger can create files at attacker-chosen locations writable by the reviewer. DuckDB external-file readers can also access files outside the mounted dataset; their results can influence exported audit evidence. These capabilities contradict the documented restriction to the supplied paths.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/rla_xlsx.py
Finding

Third-party ledger text becomes executable Excel formulas

Content
View full analysis

Impact

An attacker can inject calculated content or deceptive hyperlinks into the exported workbook. In spreadsheet applications supporting external-request formulas, a formula can also initiate an attacker-directed request when evaluated, subject to application security settings. This is not evidence of automatic OS command execution.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (43)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The renderer supports the declared reporting workflow, but materially weakens its explicit freshness guarantee. It skips validation when the recorded fingerprint is absent, ledger.yaml is missing or unreadable, or no configured source files exist. Missing source files are silently filtered out. Callers can also disable checking through --no-verify or verify_snapshot=False, and --verify can report success without actually comparing fingerprints. Additionally, load() populates global state before checking freshness, so catching a stale-data exception leaves that state available for rendering. These are enforcement gaps rather than unrelated or malicious capabilities. The broader ledger-generation and audit-output features cannot be assessed from this renderer-only chunk; their absence here is not itself a mismatch.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `rla_track.py` / `rla_collect.py` / `rla_track_node.cjs` | 录像(Python)/ 记账 / 录像(Node 钩子) |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `examples/build_report.mjs` | Node 出报告的最小可用示例(照抄即可) |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · examples/cross-file-demo.md (reported line 73)May include surrounding context.

删掉

text
rm -rf rla-demo/

--check reports success without checking invariants or comparing fingerprints.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The --check branch returns success after loading configuration and computing an optional current fingerprint, without comparing it to the ledger or evaluating invariants. Automation relying on the advertised validation contract can consequently approve stale or invalid report data.

Content

No source excerpt is available for this finding.

Snapshot verification fails open, allowing rendering and a successful verification result without establishing data freshness.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Verification only rejects a mismatch when both recorded and current fingerprints are available. Missing fingerprints, unavailable configuration, parse failures, or absent source files can therefore permit rendering and an affirmative --verify message without establishing freshness, directly bypassing the skill's central safety gate.

Content

No source excerpt is available for this finding.

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/rla_track.py (reported line 160)May include surrounding context.

python
hook_dir = Path(tempfile.mkdtemp(prefix="rla_hook_"))
    (hook_dir / "sitecustomize.py").write_text(HOOK_SOURCE, encoding="utf-8")

    env = dict(os.environ)
    # PYTHONPATH 里既有钩子目录(sitecustomize),也有技能 scripts 目录 ——
    # 后者是为了让业务脚本能 `from rla_note import note`(非 SQL 数字登记)
    _skill_scripts = str(Path(__file__).resolve().parent)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The audit query adapter can persistently modify the source database.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The audit adapter opens the source database with write permissions and executes unrestricted SQL from stdin. Although ordinary uncommitted DML is rolled back on close, standalone statements such as DROP TABLE can persist, allowing an untrusted audit query to destroy source data instead of merely verifying it.

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/rla_audit.py (reported line 192)May include surrounding context.

python
import tempfile
    fd, out = tempfile.mkstemp(suffix=".csv")
    os.close(fd)
    p = subprocess.run([sys.executable, gw, "--sql", sql, "--out", out, "--limit", "10", "--timeout", "120"],
                       capture_output=True, text=True)
    if p.returncode != 0:
        raise RuntimeError(p.stderr[-300:])

The reproduction-command sanitizer preserves directory information despite explicitly promising to remove it.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The sanitizer only redacts arguments recognized as absolute paths, leaving relative directory paths and paths embedded inside --command strings intact. It also applies host-dependent os.path.basename to Windows paths, which can preserve the entire Windows directory string on POSIX; consequently, the generated manifest and HTML can disclose customer or internal directory information despite their redaction guarantee.

Content

No source excerpt is available for this finding.

Tainted flow: 'path' from pathlib.Path.read_text (line 1909, file read) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/rla_audit.py (reported line 879)May include surrounding context.

python
rows = _evidence_rows(res)
    path.parent.mkdir(parents=True, exist_ok=True)
    # utf-8-sig 带 BOM:Windows Excel 直接双击打开中文才不乱码(实测坑)
    with open(path, "w", encoding="utf-8-sig", newline="") as f:
        w = csv.DictWriter(f, fieldnames=EVIDENCE_COLS, extrasaction="ignore")
        w.writeheader()
        for r in rows:

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/rla_audit.py (reported line 1829)May include surrounding context.

python
checks_cfg = pol.get("checks") or {}
    leaks_on = bool(checks_cfg.get("leak_rules")) and bool(checks_cfg.get("leak_patterns"))
    client_files = [p for p in paths
                    if any(__import__("fnmatch").fnmatch(p.name, pat)
                           for pat in (checks_cfg.get("leak_patterns") or []))]
    exec_status = [
        ("复算", f"{len(recomputed)}/{len(verifiable_nums)}" if (mounts or args.gateway or args.command)

Tainted flow: 'missing' from pathlib.Path.read_text (line 1577, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/rla_audit.py (reported line 1867)May include surrounding context.

python
f"上下文「{(u.get('context') or '')[:40]}」"),
                "suggest_sql": _suggest_sql(ledger, u),
            })
        out.write_text(json.dumps({
            "schema": "report-ledger/1.0",
            "purpose": "backfill-checklist",   # 标明这是「待补清单」,不是可直接审计的账本
            "report": {"name": f"{rep.get('name')} · 待补账",

Tainted flow: 'md' from pathlib.Path.read_text (line 1896, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/rla_audit.py (reported line 1899)May include surrounding context.

python
md = render_md(res)
    if not args.no_write:
        out.parent.mkdir(parents=True, exist_ok=True)
        out.write_text(md, encoding="utf-8")
        print(md)
        print(f"\n(结论已写入 {out})")
        if not args.no_html:

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/rla_collect.py (reported line 144)May include surrounding context.

python
def execute(self, sql):
        import csv as _csv
        import io as _io
        p = subprocess.run(self.argv, input=str(sql), capture_output=True,
                           text=True, timeout=self.timeout)
        if p.returncode != 0:
            raise RuntimeError(f"取数命令退出码 {p.returncode}:{p.stderr[-300:]}")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

Running the explicitly selected gateway script is intended and the argument-list construction does not demonstrate shell injection. However, this subprocess call has no enforced timeout: passing --timeout to the child does not stop a hung or noncompliant gateway, so it can block the audit indefinitely.

Content

Scanner excerpt · scripts/rla_collect.py (reported line 163)May include surrounding context.

python
fd, out = tempfile.mkstemp(suffix=".csv")
        os.close(fd)
        try:
            p = subprocess.run([sys.executable, self.script, "--sql", str(sql),
                                "--out", out, "--limit", "100000",
                                "--timeout", str(self.timeout)],
                               capture_output=True, text=True)

The documented --no-recompute option still executes queries when --command or --gateway is supplied.

Medium
Category
Excessive Agency
Confidence
100% confidence
Finding

CommandConn or GatewayConn is created before --no-recompute is applied, and the flag only prevents subsequent source construction. Because the query loop uses conn rather than the flag to decide whether to execute, a supposedly non-executing collection run still launches adapters and submits queries, potentially causing unauthorized access or side effects.

Content

No source excerpt is available for this finding.

Tainted flow: 'ledger' from pathlib.Path.read_text (line 70, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/rla_derive.py (reported line 118)May include surrounding context.

python
print(f"   ✅ 已写入账本 {nid}(auto_suggested: true)\n")

    if args.apply and added:
        lp.write_text(json.dumps(ledger, ensure_ascii=False, indent=2), encoding="utf-8")
        print(f"已写入 {added} 条派生到 {lp.name}")
        print("⚠️  这些条目标了 auto_suggested: true —— 请人工确认口径后再交付。")
    elif args.apply:

The default extraction path silently discards warnings about skipped numbers, contradicting the documented transparency requirement.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The compatibility extraction function discards warnings, and the CLI uses that function. Report-controlled audit-skip sections can therefore exclude numbers without disclosure in the extraction output, undermining the skill's audit-transparency guarantee; image-coverage warnings are also lost.

Content

No source excerpt is available for this finding.

The promised rejection of all unresolved SQL placeholders only checks two placeholder names.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Residual-placeholder validation only searches for pool and cap, allowing other unresolved placeholders to reach the database. Although many placements will cause SQL errors, placeholders inside string literals can execute successfully and silently change filtering or calculated values, violating the audit integrity guarantee.

Content

No source excerpt is available for this finding.

--list writes and can overwrite the ledger despite its no-write help text.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The --list option reaches the unconditional ledger write before printing values, despite being advertised as non-writing. An inspection command can overwrite an established audit artifact with newly calculated values, changing evidence and provenance unexpectedly.

Content

No source excerpt is available for this finding.

Tainted flow: 'buf' from os.environ.get (line 89, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/rla_note.py (reported line 91)May include surrounding context.

python
buf = current_buffer()
    buf.parent.mkdir(parents=True, exist_ok=True)
    with open(buf, "a", encoding="utf-8") as f:
        f.write(json.dumps(rec, ensure_ascii=False) + "\n")
    return v

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/rla_replay.py (reported line 42)May include surrounding context.

python
cmd += ["--policy", policy]
    for m in mounts:
        cmd += ["--mount", m]
    p = subprocess.run(cmd, capture_output=True, text=True)
    concl = ""
    for line in p.stdout.splitlines():
        if "结论" in line:

Replay returns success after skipping unready audits, contradicting its documented exit-code contract.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Unready audits are skipped without contributing to the final failure status. A replay in which some or all reports could not be evaluated can return zero and report no changes, misleading deployment automation into treating an incomplete policy comparison as successful.

Content

No source excerpt is available for this finding.