Back to skill

Security audit

图纸炸块 · 拆散指定块输出可编辑副本

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this CAD block editing skill suspicious because scanners report that it can broaden edits beyond explicitly selected blocks and act outside the stated contract boundary; the scan is partial, so the evidence is incomplete.

Consider avoiding installation until the block-selection behavior and contract boundary are clarified. The scan reports partial analysis: all 12 bundled components were inspected, but several local references could not be resolved, so the findings do not provide complete evidence about those references.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported default of exploding all contract-listed references when no target selector is supplied violates the promise to modify only user-specified blocks and could silently broaden edits in the delivered drawing. Explicit out-of-contract handles, uncovered-instance counting, and direct contract files are documented exceptions or supported interfaces, not independently proof of malicious behavior; the main implementation is absent, so the unsafe default cannot be independently verified here.

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

python
"--skill", "cad-block-explode",
            "--entry-file", str(entry_file),
        ]
        proc = subprocess.run(cmd, capture_output=True, text=True, env=dict(os.environ))
        if proc.returncode != 0:
            print(proc.stdout[-500:], proc.stderr[-500:], file=sys.stderr)
            raise SystemExit("❌ 推送总线失败")

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

python
return 3

    tmp = Path(tempfile.mkdtemp(prefix="cadblockexplode_selftest_"))
    env = dict(os.environ)
    env["SKILLBUS_STATE_DIR"] = str(tmp / "bus")
    try:
        drawing = tmp / "fixture.dxf"

Omitting all target selectors explodes every top-level block covered by the contract.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Target selection initially includes every contract-covered top-level reference, and neither argument parsing nor pick_targets requires a selector before writing output. An omitted selector therefore silently turns a targeted editing operation into a drawing-wide transformation; preserving the source reduces direct damage but does not prevent an incorrectly modified deliverable from being used downstream.

Content

No source excerpt is available for this finding.

One ambiguous handle can select and explode multiple distinct instances despite the single-target comment.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

A numeric string is interpreted as both hexadecimal and decimal, and picked.extend(hit) retains every matching reference rather than requiring a unique match. The uncovered-handle fallback likewise queues both candidate values, so one intended handle can modify multiple distinct instances and violate the user's selected scope.

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

python
# 否则会静默用不收录 *U 的底座识图,--block 原名全线命中不了。
    (sb_reader / "manifest.json").write_text('{"version": "0.41.1"}', encoding="utf-8")
    p = run([sys.executable, str(ENTRY), "check"],
            env={**os.environ, "CODEX_SKILLS_ROOT": str(sb)})
    step("gate_reader_floor_20", p.returncode == 20,
         f"底座 0.41.1 → 退出码 {p.returncode}(期望 20)")

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

python
(sb_reader / "manifest.json").write_text('{"version": "0.47.0"}', encoding="utf-8")
    p = run([sys.executable, str(ENTRY), "check"],
            env={**os.environ, "CODEX_SKILLS_ROOT": str(sb)})
    step("gate_bus_missing_21", p.returncode == 21,
         f"只有底座没有总线 → 退出码 {p.returncode}(期望 21)")

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.

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

python
"--skill", "cad-block-explode",
            "--entry-file", str(entry_file),
        ]
        proc = subprocess.run(cmd, capture_output=True, text=True, env=dict(os.environ))
        if proc.returncode != 0:
            print(proc.stdout[-500:], proc.stderr[-500:], file=sys.stderr)
            raise SystemExit("❌ 推送总线失败")

Explicit handles bypass the promised contract-only block-evidence boundary.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Handles absent from the contract are converted into user_handle targets instead of being rejected. L1371-L1390 then locates these targets directly in drawing layouts and allows them to be exploded, contradicting the manifest's requirement that all block evidence originate in cad-file-reader contracts and the fail-closed boundary documented at L0006-L0010.

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

python
)
    import subprocess

    proc = subprocess.run(
        [sys.executable, str(client), "find-contract",
         "--project", project, "--source-file", str(source)],
        capture_output=True, text=True,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · scripts/cad_block_explode.py (reported line 1164)May include surrounding context.

python
def _oda_version(oda: Path) -> str | None:
    import plistlib

    try:
        with (oda.parent.parent / "Info.plist").open("rb") as fh:

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · scripts/cad_block_explode.py (reported line 1167)May include surrounding context.

python
import plistlib

    try:
        with (oda.parent.parent / "Info.plist").open("rb") as fh:
            return str(plistlib.load(fh).get("CFBundleShortVersionString"))
    except Exception:  # noqa: BLE001
        return None

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · scripts/cad_block_explode.py (reported line 1168)May include surrounding context.

python
try:
        with (oda.parent.parent / "Info.plist").open("rb") as fh:
            return str(plistlib.load(fh).get("CFBundleShortVersionString"))
    except Exception:  # noqa: BLE001
        return None

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

python
cmd = [str(oda), str(indir), str(outdir), version, kind,
               "0", "1" if audit else "0", "*" + src.suffix.lower()]
        try:
            proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
        except subprocess.TimeoutExpired:
            raise RuntimeError(f"ODA 转换超时(>{timeout}s)")
        produced = sorted(p for p in outdir.iterdir()

The skill independently discovers and classifies blocks outside the reader contract.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The manifest says the skill does not independently interpret drawings and obtains all block evidence from cad-file-reader. This loop scans every layout for uncovered instances, reads their block names and XDATA, and produces classifications and handling advice at L1430-L1460; these are independently derived block observations, not merely contract-field transport or required editing of selected targets.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · scripts/entry_gate.py (reported line 113)May include surrounding context.

python
out.append(Path(raw).expanduser())
    out.extend(root / slug for root in _default_roots())
    if slug == "cad-file-reader":
        out.extend(sorted(Path.home().glob(".workbuddy/skills/*/cad-file-reader")))
    return out

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

python
def run(cmd: list[str], **kw) -> subprocess.CompletedProcess:
    return subprocess.run(cmd, capture_output=True, text=True, **kw)


def make_fixture(path: Path) -> str:

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/cad_block_explode.py (reported line 1831)May include surrounding context.

python
try:
        for style in doc.dimstyles:
            for attr in ("dimblk", "dimblk1", "dimblk2", "dimldrblk"):
                name = str(getattr(style.dxf, attr, "") or "")
                if name:
                    protected.add(name)
    except Exception: