Back to skill

Security audit

tujian-suanliang

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because scanners report mismatches between its declared quantity-estimation purpose and some implemented behavior, along with automatic download and execution of a separate dependency; inspection was partial.

The verdict is suspicious, not malicious. Consider avoiding installation unless you need this skill and can review its setup and quantity outputs; scanners report automatic execution of a separately downloaded dependency and mismatches or reliability issues in the declared functionality. Inspection covered 95.5% of components, with some files only partially inspected, so the evidence is incomplete.

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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (45)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The decisive behavior is the unconditional return 23 immediately after parse_args() and the retirement notice in main(). Consequently, this script does not execute CAD scanning, structural modeling, quantity calculations, or report generation, despite extensive unreachable code for those tasks. It also does not invoke the replacement workflow mentioned in the notice. This is a functional description-versus-behavior mismatch, not evidence of malicious activity. Imported modules and replacement scripts were not supplied, so their behavior cannot be assessed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The executable logic only classifies existing text records, counts keyword matches, and produces a checklist. This is related preparatory work, but as supplied, the script's primary function materially differs from the declared estimation purpose. Its local input/output operations support that checklist function; no network access, command execution, or unrelated resource access is evident.

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

python
if not script_path.exists():
        raise FileNotFoundError(f"缺少脚本:{script_path}")
    command = [sys.executable, str(script_path), *arguments]
    environment = os.environ.copy()
    current = environment.get("PYTHONPATH")
    environment["PYTHONPATH"] = os.pathsep.join(
        [str(SCRIPTS_DIR), str(BASE_SCRIPTS_DIR), str(VENDOR_DIR),

The estimator automatically downloads, installs, and executes a separate skill.

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The script automatically installs a remotely fetched dependency and executes its ensure_runtime.sh with the user's privileges. The SHA-256 comparison detects mismatches but does not independently authenticate the release because the archive and expected checksum come from the same configurable repository; compromise of that release source could therefore lead to arbitrary code execution. The dependency is relevant to CAD processing, but that does not eliminate the external-code trust boundary.

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

python
def run(cmd: list[str], cwd: Path) -> tuple[int, str]:
    import os as _os
    env = dict(_os.environ)
    env["PYTHONIOENCODING"] = "ascii"
    env["PYTHONUTF8"] = "1"
    cad = _cad_base()

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

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 audit report unconditionally claims a completed DWG verification and rules out window-clipped beams without performing that verification.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The Markdown renderer unconditionally states that an expanded-window rerun of the source DWG found zero additional entities, but this script neither performs that rerun nor requires evidence of it. This fabricates verification and could cause users or downstream agents to dismiss omitted beams; review-required flags and exclusion from formal quantities reduce, but do not eliminate, the reporting-integrity risk.

Content

No source excerpt is available for this finding.

Inherited concrete grades can be marked as not requiring review, contrary to the module's explicit evidence policy.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Inherited grades can receive needs_review=false based on heuristic interval confirmation, despite the module's stated requirement that inherited values always require review. The rules-draft output propagates that flag without retaining the inheritance marker, allowing inferred concrete grades to appear sufficiently verified to downstream consumers; draft labeling reduces but does not eliminate the material-planning integrity risk.

Content

No source excerpt is available for this finding.

The claimed replacement of externally borrowed expansion counts with drawing-derived evidence still uses external model counts.

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The expansion ratio still uses model_count from the external ledger, so agreement between reconstructed and model area does not independently validate instance counts from the drawing. Presenting this reconciliation as replacement of externally borrowed counts can launder incorrect external counts into apparently drawing-supported evidence, although explicit model-count fields and the separate count-evidence gate provide some mitigation.

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

python
env = os.environ.get("CAD_SKILL_DIR")
    candidates = [Path(env)] if env else []
    candidates += [SKILL_DIR.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"]
    for candidate in candidates:

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

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

python
attempts: list[dict[str, Any]] = []
    for attempt in range(1, retries + 2):
        try:
            completed = subprocess.run(
                command,
                capture_output=True,
                text=True,

Tainted flow: 'command' from pathlib.Path.read_text (line 123, file read) → subprocess.run (code execution)

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

python
attempts: list[dict[str, Any]] = []
    for attempt in range(1, retries + 2):
        try:
            completed = subprocess.run(
                command,
                capture_output=True,
                text=True,

The area-identity check prohibits proportional reconciliation that the partition calculation performs.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

Partition areas are calculated by multiplying the supplied panel area by sampled cell proportions, so their sum will approximately match that supplied area regardless of geometric accuracy. The identity gate consequently offers circular assurance and can pass materially undersampled or inconsistent geometry, although these outputs are explicitly marked non-formal.

Content

No source excerpt is available for this finding.

Thickness-label verification accepts text that its docstring explicitly excludes.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The numeric extractor does not reliably exclude reinforcement strings, and _is_thickness_label accepts arbitrary text whenever its layer name lacks DIM. Unrelated or crafted drawing text can therefore verify an unsupported thickness claim, giving that thickness priority over hatch evidence and compromising quantity estimates; the explicitly non-formal output limits downstream impact.

Content

No source excerpt is available for this finding.

Column construction accepts nonrectangular, incomplete contours and converts them to bounding-box rectangles, contrary to the documented rectangular-only acceptance policy.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Column contours are converted to bounding-box rectangles without checking rectangularity or requiring a fully closed boundary; the contour extractor can bridge gaps up to 1200 mm. Malformed or deliberately crafted CAD geometry can therefore inflate column volumes and introduce nonexistent endpoint-support geometry, undermining the skill's quantity estimates. Candidate/review warnings and the explicit prohibition on using results for final settlement reduce the impact, but do not prevent incorrect geometry from propagating into calculations.

Content

No source excerpt is available for this finding.

Contracts without a verified hash are admitted as formal despite the documented hash-match requirement.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

With default settings, an input declaring reader/bus provenance and a nonempty contract_id receives formal status even when its hash is absent and explicitly unverified. Someone controlling the input can omit the hash and self-assert trusted provenance to obtain formal-ledger eligibility, undermining the boundary between manual estimates and authorized contracts.

Content

No source excerpt is available for this finding.

The documented SKILL_NO_BASE opt-out is checked only after an existing dependency's bootstrap may execute.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

An existing dependency's ensure_runtime.sh is executed before SKILL_NO_BASE is checked, so setting the documented opt-out does not prevent dependency execution. This can cause unwanted setup, network access, or local changes despite the user's request to avoid the dependency; the bootstrap's exact behavior is not included in this source.

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 重建,不应在脚本里硬依赖"),

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

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

python
return Path(os.environ["CAD_SKILL_DIR"])
    here = Path(__file__).resolve().parent.parent
    for d in (here.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 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/qty_core.py (reported line 169)May include surrounding context.

python
except SystemExit as exc:
        log(f"[测量] 底座缺少测量候选入口(不阻断出量):{exc}")
        return False
    r = subprocess.run(
        ["bash", str(script), str(detail), "--out-dir", str(measure_out)],
        capture_output=True, text=True,
    )

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

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

python
except SystemExit as exc:
        log(f"[测量] 底座缺少测量候选入口(不阻断出量):{exc}")
        return False
    r = subprocess.run(
        ["bash", str(script), str(detail), "--out-dir", str(measure_out)],
        capture_output=True, text=True,
    )