Back to skill

Security audit

anzhuang-suanliang

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because scanners report automatic installation and execution of a separate skill, a path that may select code to execute, and capabilities that do not clearly match the stated quantity-planning purpose.

Consider the suspicious verdict before installing. The findings most relevant to that decision are the reported automatic installation and execution of a separate skill, the environment-selected validator, and behavior that may not match the stated purpose. The scan is marked partial because a referenced path was missing, so the evidence does not cover everything; the report does not establish malicious intent.

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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (17)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code's primary purpose is software portability auditing, not installation quantity estimation or material planning. It contains no construction takeoff, cable-tray, sprinkler, or material-planning logic. Although linting can support development, this standalone scanner has no demonstrated connection to implementing the declared functionality. The suggested fix commands are printed as text, not executed, and the visible code shows no network access or file modification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
81% confidence
Finding

差异主要在业务范围:所给片段围绕市政几何数据和市政管长统计,而非声明中的安装工程算量场景。CAD 读取本身属于支持性实现细节,不单独构成不匹配。片段未显示金额计算或结算功能,因此未发现违反这两项限制的行为。

Content

No source excerpt is available for this finding.

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 documented formal-admission policy requires matching hashes, but the default implementation admits contracts with no embedded hash.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

By default, removing the embedded hash only produces a warning, while self-declared reader/bus provenance and a nonempty contract ID still allow formal-ledger eligibility. Someone able to supply or modify a contract can therefore bypass the stated integrity gate and introduce manipulated quantities; the returned calculated digest records the input but does not authenticate it.

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

python
os.environ.get("CAD_SKILL_DIR"),
        Path.home() / ".codex" / "skills" / "cad-file-reader",
        Path.home() / ".claude" / "skills" / "cad-file-reader",
        *sorted(Path.home().glob(".workbuddy/skills/*/cad-file-reader")),
    ])

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

The quantity-planning skill can automatically download, install, and execute a separate skill.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

When invoked without a suitable installed dependency, this helper automatically downloads a separate skill, installs it, and executes its runtime bootstrap with the caller's privileges. The checksum comes from the same configurable repository as the archive, so it detects corruption but does not protect against a compromised release source or malicious repository override; printing a notice is not explicit installation approval.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/lint_cross_platform.py (reported line 67)May include surrounding context.

python
"SIGKILL 仅 POSIX。fix: 平台分支外避免直接 kill;Windows 用 terminate()"),
    ("NATIVE_DYLIB",
     re.compile(r"\b[\w.-]+\.dylib\b"),
     "dylib 是 macOS 原生库格式。fix: 仓库内 sudo 二进制请走 platform 分支;Windows/Linux 由 pip wheel 提供"),
    ("DARWIN_SO",
     re.compile(r"\.cpython-\d+[^-]*-darwin\.so\b"),
     "darwin 专有扩展名出现在业务脚本里通常是误引用。fix: vendor 由各平台 setup/pip 重建,不应在脚本里硬依赖"),

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

python
base = os.environ.get("CAD_SKILL_DIR")
    if not base:
        for d in (Path(__file__).resolve().parent.parent.parent / "cad-file-reader",
                  *sorted(Path.home().glob(".workbuddy/skills/*/cad-file-reader")),
                  Path.home() / ".claude/skills/cad-file-reader",
                  Path.home() / ".codex/skills/cad-file-reader"):
            if Path(d).is_dir():

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

python
if not validator.exists():
        return {}
    try:
        r = subprocess.run(["bash", str(validator), path], capture_output=True, text=True, timeout=180)
    except Exception as exc:
        return {"ok": False, "errors": [f"{type(exc).__name__}: {exc}"]}
    errors = []

Tainted flow: 'validator' from os.environ.get (line 1119, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
83% confidence
Finding

CAD_SKILL_DIR determines the script executed by bash, but the code only checks that the resulting path exists, without establishing that it belongs to a trusted dependency installation. If an attacker can influence this environment setting or modify a discovered helper installation, supplying --cad-measurement triggers arbitrary code execution with the agent's privileges; the JSON contents alone do not demonstrate this capability.

Content

Scanner excerpt · scripts/mep_plan.py (reported line 1123)May include surrounding context.

python
if not validator.exists():
        return {}
    try:
        r = subprocess.run(["bash", str(validator), path], capture_output=True, text=True, timeout=180)
    except Exception as exc:
        return {"ok": False, "errors": [f"{type(exc).__name__}: {exc}"]}
    errors = []

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

python
manifest = root / "manifest.json"
    if manifest.is_file():
        try:
            data = __import__("json").loads(manifest.read_text(encoding="utf-8"))
            version = data.get("version")
            if isinstance(version, str) and version.strip():
                return version.strip()

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The open-ended dependency range permits future installations to select releases that have not been reviewed or tested with this skill. This is a supply-chain hardening weakness rather than evidence of an existing exploit, but a compromised permitted release could execute code during installation or use.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
# 依赖声明:优先走识图底座 cad-file-reader 的 vendor/;缺失时:
#   python3 -m pip install -r requirements.txt
openpyxl>=3.1

Unverifiable Dependency: openpyxl has 2 known advisory(ies) (CVE-2017-5992 (Improper Restriction of XML External Entity Reference in Openpyxl); CVE-2017-5992 (Openpyxl 2.4.1 resolves external entities by default, which allows remote attack)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

scripts/lint_cross_platform.py documents comment-only matches as WARN findings, but skips comments entirely.

Low
Category
Excessive Agency
Confidence
98% confidence
Finding

The module documentation at L008–L010 promises WARN output when platform-specific operations are mentioned in comments or explanatory text. However, L107–L108 unconditionally discard lines recognized as comments, preventing those matches from reaching the reporting logic and contradicting the documented review coverage.

Content

No source excerpt is available for this finding.

scripts/mep_scan.py claims to scan DWG drawings, but its CLI explicitly rejects drawing input and only consumes JSON contracts.

Low
Category
Excessive Agency
Confidence
97% confidence
Finding

The module docstring at L002 describes scanning installation DWG drawings, and L615–L617 reuse it as the Chinese CLI description. In contrast, L646–L663 explicitly reject drawing input and require contract-consumption mode, making the advertised input behavior inconsistent with the implemented entry point.

Content

No source excerpt is available for this finding.

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

python
os.environ.setdefault("PYTHONIOENCODING", "utf-8")
    os.environ.setdefault("PYTHONUTF8", "1")
    for _name in ("stdout", "stderr"):
        _stream = getattr(sys, _name, None)
        _reconf = getattr(_stream, "reconfigure", None)
        if callable(_reconf):
            try: