Back to skill

Security audit

CAD Tmp Probe

Security checks for vulnerabilities and agentic risk

Overview

This drawing-analysis skill needs review because its automatic converter search can run untrusted code from a shared temporary folder.

Prefer a version that removes shared temporary folders from executable discovery. Until then, use DXF inputs or a verified converter on PATH. Expect first-run package downloads and optional local storage of project evidence. Run scrubber --apply only on disposable copies.

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/platform_paths.py:268
Finding

Automatic converter discovery trusts a predictable shared temporary directory

Content
View full analysis

Impact

Arbitrary code execution as the user running the Skill, allowing access to that user's drawings and other readable files and modification of their writable files.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (134)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied chunk implements a release-time sanitization utility, not CAD/PDF parsing or recognition-candidate generation. Although release hygiene can support a larger project, this script exposes a standalone scanning and file-rewriting capability that is not described in the declared purpose. Its optional redaction operates directly on source files, making the difference substantive rather than merely an internal implementation detail. No network transmission or final engineering-quantity calculation is shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

Contract validation, hashing, confidence metadata, and final_quantity=false are consistent with the declared purpose. However, this chunk's primary function is cross-skill state synchronization rather than parsing or ordinary parser caching. The description does not disclose the shared bus integration, external client execution, or shared-state updates. No direct network access or final-quantity calculation is shown; the mismatch concerns the additional integration and persistence capabilities, not the absence of parsing in this helper.

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

md
- 依赖自检:`bash scripts/deps_check.sh --minimal`;缺 numpy 只影响梁线几何估算,其余功能降级为 review。

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

md
- 30 秒样例:`bash scripts/demo.sh`;完整包用内置 `examples/sample_room.dxf`,SkillHub 轻量包若含 `.dxf` 则由 `scripts/generate_sample.py` 现场重建同一样例(跑识图→测量→契约校验)。

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

md
平台安装与 FAQ 见 `README.md`“平台支持矩阵”。

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

md
- `--state-push` / `--resume` 分别为 push / pull 的别名;Windows 统一用 `python scripts/cad_statesync.py push/pull ...`(Windows SkillHub 版无 `.cmd`,直接走 py 入口,功能等价)。

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

md
- Windows 接线:Windows SkillHub 版无 `.cmd`,统一用 `python scripts/cad_statesync.py push/pull ...`(功能一致)。Windows 未实机跑通,仅静态校验通过(CRLF 行尾;无 /Users、/bin/sh、python3 硬编码;py

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

md
发布前仍跑 `scripts/run_preflight.sh`:依次执行全量 self-test、契约样例校验、`cad_release_scrub.py` 脱敏扫描;带真图清单时加 `--manifest <本地真图清单.json>` 跑真实图纸回归。任一环节失败即视为未通过,禁止发布(本机自测现 205 项)。

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 99)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:

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

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

python
"ok = all(u.find_spec(m) is not None for m in mods)\n"
        "print('import_ok=' + str(ok))\n"
    )
    env = dict(os.environ)
    env["PYTHONPATH"] = str(dest) + os.pathsep + env.get("PYTHONPATH", "")
    env["PYTHONUTF8"] = "1"
    proc = subprocess.run([interpreter, "-c", code], env=env, capture_output=True, text=True, timeout=120)

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

python
cmd = [python, str(SETUP_PY)]
    if "--dry-run" in sys.argv:
        cmd.append("--dry-run")
    env = dict(os.environ)
    env["PYTHONUTF8"] = "1"
    r = subprocess.run(cmd, env=env)
    if r.returncode != 0:

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_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_landscape_geometry.py (reported line 57)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}")

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 71)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 92)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()

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/setup.py (reported line 180)May include surrounding context.

python
elif not args.quiet:
            print("vendor 已由 GitHub Release 完整包补齐。")

    env_file = SKILL_DIR / ".env"
    if not env_file.exists() or "PYTHONPATH=" not in env_file.read_text(encoding="utf-8", errors="ignore"):
        env_file.write_text(
            f"# 由 scripts/setup.py 生成;供未走 run_cad 自举的手工调用使用\n"

Obfuscated Code

High
Category
Supply Chain
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · scripts/tests/test_cad_interpret.py (reported line 108)May include surrounding context.

python
def test_rejects_arbitrary_code(self):
        hostile = [
            "__import__('os').system('echo hi')",
            "().__class__.__base__.__subclasses__()",
            "open('/etc/passwd').read()",
            "[x for x in range(3)]",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tests/test_cad_interpret.py (reported line 110)May include surrounding context.

python
hostile = [
            "__import__('os').system('echo hi')",
            "().__class__.__base__.__subclasses__()",
            "open('/etc/passwd').read()",
            "[x for x in range(3)]",
            "sys.exc_info()",
            "namespace.get('_SAFE_FUNCS')",

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, 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 contract requires Chinese explanations in `review_notes` without user opt-in.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

L080 specifies that review_notes retain Chinese explanations, imposing a natural-language constraint on user-facing output. Although the manifest lists both zh-CN and en-US, the instruction provides no user language choice or documented justification for requiring Chinese in this field.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.