Back to skill

Security audit

engineering-drawing-prep

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent local engineering-document workflow, but it can delete files from the original client-supplied folder without confirmation despite describing that folder as read-only.

Review before installing or running on real client deliverables. Use a copy of ./clientgiven, not originals, because the intake script deletes ._* , .DS_Store, .dwl, and .dwl2 files in place. Treat generated RFIs and audit reports as advisory checks that need engineering review, and avoid following unpinned pip install guidance outside a virtual environment or approved package process.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/01_intake_audit.sh:22
Finding

Intake Audit Destructively Modifies Documented Read-Only Source Data

Content
View full analysis

Vulnerability Details

File Location: scripts/01_intake_audit.sh, lines 22-26
Vulnerability Type: Destructive source-data mutation
Risk Level: High

bash
# 1. Clean macOS noise
echo "[1/4] Removing macOS noise files..."
find "$SRC" -type f \( -name '._*' -o -name '.DS_Store' -o -name '*.dwl' -o -name '*.dwl2' \) -print > "$NOISE_LOG" | while read -r f; do
    rm -f "$f"
done

Technical Analysis

The intake workflow permanently deletes matched files from the supplied source directory. This conflicts with the source directory being described as read-only in README.md and SKILL.md.

In addition to macOS metadata, the deletion pattern includes all .dwl and .dwl2 files. These are AutoCAD lock and state files that can indicate drawings currently in use. The script performs no confirmation, backup, source/output boundary validation, or dry-run step before deletion.

Because deletion occurs before inventory and hashing, the resulting manifest cannot prove exactly what the client originally supplied: deleted files never appear in the manifest.

Attack Path

  1. A client, attacker, or upstream process places a required file in the source tree with a matched name or .dwl/.dwl2 suffix.
  2. An operator invokes the documented intake command against that directory.
  3. find identifies the file and passes its path to rm -f.
  4. The file is deleted under the invoking user's permissions without confirmation or backup.
  5. Inventory and hashing run only after deletion, omitting the removed artifact from the evidentiary record.

Impact Assessment

The script can delete every matched file reachable beneath SRC for which the invoking user has write permission. It does not obtain elevated privileges, but it can cause irreversible loss of client deliverables, interfere with active AutoCAD sessions, and undermine archive integrity and audit claims.

Remediation
View remediation

Remediation Suggestions

  • Treat the source tree as immutable and never invoke rm against it.
  • Record unwanted files in the audit report without deleting them.
  • If cleaning is required, first copy the source into a dedicated staging directory and remove files only from that copy.
  • Add canonical-path validation to ensure source and output directories do not overlap.
  • Require an explicit opt-in flag for destructive cleanup and provide a dry-run listing.
  • Inventory and hash all original files before any optional cleanup.
  • Use null-delimited traversal to handle unusual filenames safely.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/01_intake_audit.sh:32
Finding

Unescaped Filenames Can Corrupt or Forge JSONL Manifest Records

Content
View full analysis

Vulnerability Details

File Location: scripts/01_intake_audit.sh, lines 32-50
Vulnerability Type: Untrusted data injection into JSON output
Risk Level: Medium

bash
find "$SRC" -type f | sort | while read -r f; do
    rel="${f#$SRC/}"
    size=$(stat -f%z "$f" 2>/dev/null || stat -c%s "$f" 2>/dev/null || echo "unknown")
    hash=$(shasum -a 256 "$f" 2>/dev/null | awk '{print $1}' || sha256sum "$f" 2>/dev/null | awk '{print $1}' || echo "unsupported")
    ext="${f##*.}"
    ext_lower=$(echo "$ext" | tr '[:upper:]' '[:lower:]')
    mime="unknown"
    case "$ext_lower" in
        dwg) mime="application/acad" ;;
        dxf) mime="application/dxf" ;;
        pdf) mime="application/pdf" ;;
        xlsx|xls) mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ;;
        docx|doc) mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document" ;;
        shx|ttf) mime="font" ;;
        *) mime="application/octet-stream" ;;
    esac
    printf '{"path":"%s","size":%s,"sha256":"%s","mime":"%s","timestamp":"%s"}\n' "$rel" "$size" "$hash" "$mime" "$TIMESTAMP" >> "$MANIFEST"
    printf '%s  %s\n' "$hash" "$rel" >> "$HASH_LOG"
done

Technical Analysis

The script inserts the source-relative filename directly into a JSON string using printf. It does not escape quotation marks, backslashes, control characters, or newlines according to JSON encoding rules.

Consequently, a crafted filename can create malformed JSON or inject additional apparent JSONL records. The line-oriented find | sort | while read pipeline also cannot safely distinguish filenames containing newline characters.

This is a data-integrity injection issue rather than shell command injection: the filename remains quoted when passed to shell commands, but it is not safely serialized into generated reports.

Attack Path

  1. An attacker supplies a file whose name contains JSON syntax, q ...[truncated 751 chars]
Remediation
View remediation

Remediation Suggestions

  • Generate manifest records through a real JSON serializer, such as Python's json.dumps, rather than shell string interpolation.
  • Traverse files with null delimiters, for example find ... -print0, and consume them with a null-aware loop.
  • Avoid line-oriented sorting unless using a null-aware implementation such as sort -z.
  • Validate every generated record by parsing it before declaring the audit successful.
  • Add tests covering filenames with quotes, backslashes, Unicode characters, tabs, and newlines.
  • Consider storing raw filename bytes or a safely encoded representation when exact forensic preservation is required.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/02_standardize.sh:37
Finding

Flattened DWG Output Names Cause Silent File Overwrites

Content
View full analysis

Vulnerability Details

File Location: scripts/02_standardize.sh, lines 37-42
Vulnerability Type: Predictable output collision and silent overwrite
Risk Level: Medium

bash
find "$SRC" -type f -iname '*.dwg' | while read -r f; do
    rel="${f#$SRC/}"
    base=$(basename "$rel" .dwg)
    wip_path="$OUT/${base}_WIP_${TIMESTAMP}.dwg"
    cp "$f" "$wip_path"
    count=$((count+1))
done

Technical Analysis

The script discards each source file's directory structure and derives the output name only from its basename and a run-wide timestamp. Multiple source drawings with the same basename therefore resolve to the same destination path.

The standard cp invocation overwrites an existing destination without detecting or reporting the collision. Traversal order determines which drawing survives. The script may nevertheless complete successfully, giving operators the impression that all files were processed.

Attack Path

  1. The input tree contains two drawings such as civil/plan.dwg and electrical/plan.dwg.
  2. Both names are reduced to the basename plan.
  3. Both files map to plan_WIP_<timestamp>.dwg.
  4. The later copy silently replaces the earlier copy.
  5. The generated WIP package contains only one of the drawings, while the workflow reports completion.

A malicious supplier could deliberately introduce a duplicate basename in a later-traversed directory to substitute attacker-selected drawing content for a legitimate drawing.

Impact Assessment

The issue does not provide privilege escalation. It affects the integrity and availability of generated project deliverables within the configured output directory. Legitimate drawings can be lost from the WIP package, replaced with unrelated content, or delivered under misleading identities.

Remediation
View remediation

Remediation Suggestions

  • Preserve the source-relative directory structure beneath the output directory.
  • Alternatively, include a stable hash of the relative path in each output filename.
  • Detect collisions before copying and terminate with a clear error.
  • Use exclusive or no-clobber output creation rather than unconditional overwrite behavior.
  • Produce a mapping report that records every source path and its exact destination.
  • Use null-delimited file traversal so unusual filenames are handled correctly.
  • Add tests with duplicate basenames in different source directories.

T08 · Insecure Dependencies

Warning
Location
scripts/02_standardize.sh:48
Finding

Unpinned Third-Party Package Installation Guidance Creates Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: scripts/02_standardize.sh, lines 48-51
Vulnerability Type: Unpinned dependency installation instruction
Risk Level: Medium

bash
else
    echo "[2/3] AutoCAD not found. Falling back to Python/ezdxf placeholder." | tee -a "$REPORT"
    echo "  Install ezdxf: pip install ezdxf" | tee -a "$REPORT"
fi

Technical Analysis

When AutoCAD is unavailable, the script instructs the operator to install ezdxf directly from pip without a pinned version, hash verification, lock file, or isolated environment. The script does not execute the command itself, but the instruction is presented as the remediation required to enable the fallback.

Package registry contents and transitive dependency resolution can change after the Skill has been reviewed. Python packages may execute code during installation or when imported, so following mutable installation guidance can introduce code that was never part of the audited project.

Attack Path

  1. The standardization script does not find AutoCAD.
  2. It displays the instruction pip install ezdxf.
  3. The operator follows the instruction in a system or user Python environment.
  4. Pip resolves the current package and transitive dependencies from its configured registry.
  5. A compromised release, registry, mirror, or dependency executes installation or runtime code with the operator's permissions.

Impact Assessment

If the instruction is followed, dependency code can run with the privileges of the user invoking pip. Depending on that user's access, this can affect local files, Python environments, credentials available to the process, and subsequent engineering workflows. The project itself does not demonstrate an active malicious package or automatically execute the installation.

Remediation
View remediation

Remediation Suggestions

  • Pin an explicitly reviewed ezdxf version and all transitive dependencies.
  • Provide a requirements or lock file containing cryptographic hashes.
  • Require installation in a dedicated virtual environment with minimal privileges.
  • Document the approved package index and avoid untrusted mirrors.
  • Use pip install --require-hashes for reproducible verification.
  • Add dependency scanning and periodic review of pinned versions.
  • Clarify that the current fallback is only a placeholder and is not implemented by this script.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This mismatch indicates the skill's core engineering assurances are overstated: it may infer missing survey, CRS, or document gaps from filenames and superficial heuristics rather than actual CAD or document auditing. In this context, that is risky because users may rely on incomplete or incorrect pre-design checks, leading to bad RFIs, missed coordination issues, and unsafe downstream design assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

This mismatch indicates the skill's core engineering assurances are overstated: it may infer missing survey, CRS, or document gaps from filenames and superficial heuristics rather than actual CAD or document auditing. In this context, that is risky because users may rely on incomplete or incorrect pre-design checks, leading to bad RFIs, missed coordination issues, and unsafe downstream design assumptions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises workflows that read from client folders and generate standardized outputs, but it does not declare any explicit tool scope such as allowed-tools or permissions. That makes the file and write surface implicit rather than constrained, increasing the chance that an agent executes filesystem actions broader than the user expects when handling sensitive engineering deliverables.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script documentation claims it only inventories, hashes, and audits raw client deliverables, but the implementation also removes files from the source tree. This mismatch is dangerous because operators may run the script believing it is read-only, leading to unintended destruction or alteration of client-supplied materials.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script deletes files directly from the client-supplied source directory during an intake/audit phase, which violates the expectation that raw deliverables are preserved. Even if the targeted files are considered 'noise,' this creates irreversible modification of original evidence and could remove files that are operationally relevant in some CAD workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script performs deletion of files from the source directory without a dedicated warning, confirmation step, or opt-in flag. In the context of handling client deliverables, silent destructive behavior increases the chance of accidental data loss and undermines chain-of-custody and reproducibility for project intake.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents commands that process raw client deliverables and produce standardized DWGs, PDFs, reports, tables, and RFI documents, which affects user project data. Although the outputs are described, there is no clear user-facing warning in the quick-start section that execution will create and transform files in the specified output directories.

Content

No source excerpt is available for this finding.