Back to skill

Security audit

CAD 图纸识图与证据提取

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this CAD drawing reader suspicious because it reports substantial behavior beyond its stated drawing-recognition scope, including quantity estimates, broad file discovery, and file-changing operations.

The verdict is suspicious, not malicious: the results identify significant scope and file-handling risks but do not establish clear harmful intent. Consider the reported coverage incomplete: Skillspector inspected 176 of 180 components, four were only partly inspected, and two analyzers were degraded. Review the specific file-modifying, broad-discovery, and installation behaviors before deciding whether to install.

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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (147)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Most drawing extraction and block-expansion behavior matches the declaration. However, the explicit restriction '只识图不算量' (interpret drawings only; no quantity takeoff) conflicts with analyse(), which calculates component estimates in 'est', and to_md(), which reports category totals as approximate numbers of physical components. Reinforcement summaries also include '估算根数' (estimated counts). Additionally, estimate_beam_lengths() computes summed candidate lengths, and the output functions expose total and average beam lengths. Calling these results tentative or not a substitute for professional takeoff does not remove the quantity-estimation capability. Runtime selection, subprocess decoding, caching, and conversion are supporting implementation details, not separate mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Most visible behavior supports the declared drawing-recognition and evidence-extraction purpose. However, when geometry is enabled and available, the code explicitly calls a beam-length estimation routine. It also exports reinforcement summaries with estimated quantities when those summaries are present. These capabilities conflict with the explicit promise not to perform quantity takeoff. The reinforcement calculation itself is not shown, but its estimated-count reporting is visible. Local caching, conversion fallback, and output-file creation are supporting implementation details rather than separate mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied script's primary function is repository or release-content sanitization, not drawing interpretation or evidence extraction. It processes text files using regular expressions and can modify them in place; it does not parse CAD or PDF drawings. Although sanitization could support development of the broader skill, this standalone release-auditing and redaction capability is materially different from the declared drawing-focused purpose. The description's reference to drawing hygiene does not disclose general repository scanning and rewriting.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The reported editing path can delete drawing entities and save over the input, contradicting the documented read-only service boundary and risking destruction of original evidence. The missing --keep/--project enforcement further weakens the stated editing safeguards, although the relevant implementation is not supplied in this source.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The reported default discovery across home directories and mounted drives exceeds the scope reasonably implied by interpreting supplied drawings. Inventories containing paths and inferred project names can expose unrelated confidential projects to agent context or generated artifacts, although no external exfiltration is established and the discovery implementation is not supplied.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Most behavior fits the declared drawing-recognition purpose. The concrete exception is the reachable --block-paving path: _faces() uses _poly_area() to calculate polygon areas, and _block_paving_rows() stores their absolute values as area_drawing_units2. Those areas are exported in JSON, Markdown, and CSV. Labeling them low-confidence review candidates, using drawing-unit squares rather than m², and setting final_quantity=false limits their interpretation but does not change the fact that numeric paving areas are calculated and reported. No unrelated network access or process execution is visible in the supplied chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared boundary, “只识图不算量” (drawing recognition only, no quantity calculation), does not disclose the script's central measurement-calculation capability. Extracting explicitly printed measurements and attaching evidence would fit the description, but deriving new lengths, areas, and volumes goes beyond that boundary. The outputs are consistently labeled as candidates rather than final engineering quantities, and the code does not calculate deductions, material totals, or costs; this limits but does not eliminate the mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

The reported cleanup behavior selects files by a generic .tmp suffix rather than verified cache ownership, potentially deleting unrelated project data when --cleanup --apply targets a shared directory. Explicit flags reduce accidental activation, but do not make an overbroad deletion boundary safe; the implementation is not included here for independent verification.

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_batch.py (reported line 100)May include surrounding context.

python
cmd += [str(path), "--format", "json", "--detail-json", str(detail_path), "--budget", str(budget)]
    if cache_dir:
        cmd += ["--cache-dir", str(cache_dir)]
    env = dict(os.environ)
    env.setdefault("CAD_CONCISE", "1")
    timeout = budget if budget and budget > 0 else None
    try:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_clearance.py (reported line 70)May include surrounding context.

python
rules[k] = v
        except Exception as exc:
            sys.stderr.write(f"[cad_clearance] 规则读取失败,用默认:{exc}\n")
    return rules


def device_points(texts: list[dict], rules: dict) -> dict:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_common.py (reported line 32)May include surrounding context.

python
rules = json.load(fh)
    rules_dir = path.parent / "rules"
    if not rules_dir.is_dir():
        return rules
    for jf in sorted(rules_dir.glob("*.json")):
        try:
            with jf.open("r", encoding="utf-8") as fh:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_common.py (reported line 46)May include surrounding context.

python
rules[key] = merged
            else:
                rules[key] = val
    return rules


def pattern_hit(value: str, pattern: Any) -> bool:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_earthwork.py (reported line 83)May include surrounding context.

python
rules[k] = v
        except Exception as exc:
            sys.stderr.write(f"[cad_earthwork] 规则读取失败,用默认:{exc}\n")
    return rules


def load_geometry(detail: dict):

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_landscape_geometry.py (reported line 60)May include surrounding context.

python
def load_rules_with_institute(rules, institute=None):
    if not institute:
        return rules
    rp = INSTITUTE_DIR / f"{institute}.json"
    if not rp.exists():
        raise FileNotFoundError(f"设计院图例覆盖不存在:{rp}")

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_survey.py (reported line 93)May include surrounding context.

python
rules[k] = v
        except Exception as exc:
            sys.stderr.write(f"[cad_survey] 规则读取失败,用默认:{exc}\n")
    return rules


def collect_coords(texts: list[dict], rules: dict) -> list[dict]:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_elevation.py (reported line 89)May include surrounding context.

python
rules[k] = v
        except Exception as exc:
            sys.stderr.write(f"[cad_elevation] 规则文件读取失败,用内置默认:{exc}\n")
    return rules


# ------------------------------------------------------------------ Z 通道

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_hygiene.py (reported line 84)May include surrounding context.

python
rules[key] = val
        except Exception as exc:
            sys.stderr.write(f"[cad_hygiene] 规则文件解析失败,使用内置规则:{exc}\n")
    return rules


# ---------------------------------------------------------------- 实体读取

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_interpret.py (reported line 213)May include surrounding context.

python
rules: list[dict[str, Any]] = []
    errors: list[str] = []
    if not rules_dir.is_dir():
        return rules, [f"规则目录不存在:{rules_dir}"]
    for path in sorted(rules_dir.rglob("*.json")):
        if path.name.startswith("_"):
            continue

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_interpret.py (reported line 226)May include surrounding context.

python
rules.append(item)
        except Exception as exc:
            errors.append(f"{path.name}: {exc}")
    return rules, errors


_SAFE_FUNCS = {

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/cad_sheet_frame.py (reported line 82)May include surrounding context.

python
rules[key] = val
        except Exception as exc:
            sys.stderr.write(f"[cad_sheet_frame] 规则文件损坏,使用内置规则:{exc}\n")
    return rules


def entity_text(e) -> str:

The clean-copy output can overwrite the original drawing despite the explicit promise never to modify it.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The --out path is passed directly to doc.saveas without checking whether it identifies the original drawing or an existing file. An accidental or adversarially selected path can therefore replace the original with the modified document, violating the explicit preservation guarantee and potentially destroying engineering evidence.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · scripts/cad_scan.py (reported line 89)May include surrounding context.

python
for c in cands:
        if os.path.isfile(c) and os.path.realpath(c) != cur:
            os.environ["CAD_SCAN_REEXEC"] = "1"
            os.execv(c, [c] + sys.argv)


ensure_runtime()

Obfuscated Code

High
Category
Supply Chain
Confidence
50% confidence
Finding

Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Content

Scanner excerpt · scripts/generate_sample.py (reported line 6)May include surrounding context.

python
# 用法: python3 generate_sample.py <输出路径>
import base64, pathlib, sys

DATA = 'ICAwClNFQ1RJT04KICAyCkhFQURFUgogIDkKJEFDQURWRVIKICAxCkFDMTAxNQogIDkKJEFDQURNQUlOVFZFUgogNzAKNgogIDkKJERXR0NPREVQQUdFCiAgMwpBTlNJXzEyNTIKICA5CiRJTlNCQVNFCiAxMAowLjAKIDIwCjAuMAogMzAKMC4wCiAgOQokRVhUTUlOCiAxMAoxZSsyMAogMjAKMWUrMjAKIDMwCjFlKzIwCiAgOQokRVhUTUFYCiAxMAotMWUrMjAKIDIwCi0xZSsyMAogMzAKLTFlKzIwCiAgOQokTElNTUlOCiAxMAowLjAKIDIwCjAuMAogIDkKJExJTU1BWAogMTAKNDIwLjAKIDIwCjI5Ny4wCiAgOQokT1JUSE9NT0RFCiA3MAowCiAgOQokUkVHRU5NT0RFCiA3MAoxCiAgOQokRklMTE1PREUKIDcwCjEKICA5CiRRVEVYVE1PREUKIDcwCjAKICA5CiRNSVJSVEVYVAogNzAKMQogIDkKJExUU0NBTEUKIDQwCjEuMAogIDkKJEFUVE1PREUKIDcwCjEKICA5CiRURVhUU0laRQogNDAKMi41CiAgOQokVFJBQ0VXSUQKIDQwCjEuMAogIDkKJFRFWFRTVFlMRQogIDcKU3RhbmRhcmQKICA5CiRDTEFZRVIKICA4CjAKICA5CiRDRUxUWVBFCiAgNgpCeUxheWVyCiAgOQokQ0VDT0xPUgogNjIKMjU2CiAgOQokQ0VMVFNDQUxFCiA0MAoxLjAKICA5CiRESVNQU0lMSAogNzAKMAogIDkKJERJTVNDQUxFCiA0MAoxLjAKICA5CiRESU1BU1oKIDQwCjIuNQogIDkKJERJTUVYTwogNDAKMC42MjUKICA5CiRESU1ETEkKIDQwCjMuNzU

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · scripts/run_cad.py (reported line 146)May include surrounding context.

python
if not args or args[0] not in ("--list", "-h", "--help"):
            better = _prefer_runtime_python()
            if better:
                os.execv(better, [better, str(Path(__file__).resolve())] + args)

    if not args:
        _print_usage()

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 476)May include surrounding context.

python
tmp = Path(tmpd)
        detail = tmp / "sample_detail.json"
        out_prefix = tmp / "sample_out"
        env = dict(os.environ)
        env.setdefault("PYTHONPATH", str(SKILL_DIR / "vendor"))
        env["CAD_CONCISE"] = "0"
        proc = subprocess.run(