Back to skill

Security audit

gb-cad-figure

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a CAD drawing skill, but its DWG export path can automatically download and run unverified external software, so it should be reviewed before installation.

Use this skill only if you are comfortable with its CAD scripts and with manually reviewing the DWG converter path. Prefer PDF/DXF-only operation unless you have independently installed and verified the ODA converter; do not let an agent auto-download and run the AppImage in sensitive environments. Avoid running release.sh on repositories containing private drawings, credentials, or customer data, and treat the administrator repair commands as manual troubleshooting only.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/tools/fetch_oda.sh:7
Finding

Remote executable is downloaded and run without integrity verification

Content
View full analysis
/dev/null; then chmod +x "$OUT" echo "Completed: $OUT" ``` ```bash # scripts/dxf2dwg.sh if [ ! -f "$ODA_IMG" ]; then echo "Retrieving ODA File Converter..." bash "$(dirname "$0")/tools/fetch_oda.sh" [ -f "$ODA_IMG" ] || { echo "Unable to retrieve converter"; exit 1; } fi echo "Extracting ODA File Converter..." chmod +x "$ODA_IMG" (cd /tmp && "$ODA_IMG" --appimage-extract >/dev/null 2>&1) ``` ### Technical Analysis The DWG conversion workflow automatically downloads an AppImage, assigns executable permission, and executes it. The script does not verify a cryptographic digest, detached signature, signing certificate, or trusted release manifest. Although HTTPS protects transport under normal conditions, it does not establish that the downloaded artifact is the exact binary reviewed by the project. The use of `curl -L` also follows redirects, making the effective source dependent on the complete remote delivery chain. This creates a mutable remote code-execution channel: compromise of the hosting service, redirect target, DNS/TLS trust chain, or upstream release process could replace the converter after this Skill has been reviewed. ### Attack Path 1. An attacker compromises the download endpoint, an allowed redirect destination, or the upstream artifact distribution process. 2. The attacker serves a modified AppImage at the expected URL. 3. A user invokes `script ...[truncated 809 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/dxf2dwg.sh:10
Finding

Predictable shared temporary executable can be pre-positioned and hijacked

Content
View full analysis
/dev/null 2>&1) } [ -d "$OUT" ] || mkdir -p "$OUT" if [ -f "$IN" ]; then tmpi="$OUT/.dxfin" rm -rf "$tmpi" mkdir -p "$tmpi" cp "$IN" "$tmpi/" xvfb-run -a "$ODA" "$tmpi" "$OUT" "$VER" DWG 0 1 "*.dxf" ``` ### Technical Analysis The script uses the fixed shared path `/tmp/squashfs-root/AppRun` for the executable extracted from the AppImage. Before extraction, it only tests whether that path is executable: ```bash [ -x "$ODA" ] || { ...extract...; } ``` It does not verify ownership, permissions, file type, origin, or integrity. If an executable already exists there, extraction is skipped and that executable is passed directly to `xvfb-run`. Shared temporary directories are generally writable by multiple local users or processes. A predictable executable path in such a location creates a pre-positioning race and substitution vulnerability. The configurable `ODA_ROOT` environment variable further permits execution from an arbitrary supplied directory, although deliberate environment control normally presumes influence over the invoking process. ### Attack Path 1. An attacker with access to the same host creates `/tmp/squashfs-root`. 2. The attacker places a malicious executable at `/tmp/squashfs-root/AppRun` and marks it executable. 3. The victim ...[truncated 816 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gb_figure.py:413
Finding

Fixed temporary preview paths permit collisions and symlink-based overwrites

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
release.sh:9
Finding

Release script automatically commits and publishes every repository file

Content
View full analysis
Remediation
View remediation
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (40)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是工程制图/CAD 生成能力,但实际代码并未执行任何图纸生成、CAD模板创建、国标标注、DWG/DXF/PDF导出等功能。相反,它是一个仓库发布/同步脚本,主要用途是源码提交与推送到多个代码托管平台,并提示后续发布步骤。这属于与声明主用途 materially different 的行为,且涉及未声明的外部资源访问(Gitee、GitHub、ClawHub 发布流程)。因此应判定为明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个面向GB/T正式工程制图的生成型工作流,核心应是创建或导出符合国标的图纸与模板。实际代码仅执行静态检查:读取现有DXF,审查文字样式与中文字体配置,输出诊断结果并返回成功/失败状态。这与“生成正式工程图纸与CAD模板”的主要目的存在明显差异。虽然字体属于声明中提到的一个方面,但这里只覆盖非常狭窄的字体自检子任务,且没有体现国标图框、标注、模板生成、三格式交付等主体功能,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一套面向正式工程制图的国标 CAD 工作流,重点在标准化图框、标注、模板和多格式 CAD 交付。而代码仅实现了一个具体示例:对“方凳”几何体(box + cylinders)做正等轴测投影、可见性/遮挡判定,并绘制可见轮廓到 PDF,再导出 PNG。虽然“等轴测”与描述中的一小部分方向相关,但其核心能力与声明差异很大:没有任何 GB/T 标准要素、没有尺寸与标注系统、没有 CAD 模板或 DXF/DWG 生成,输出资源和用途都更像可视化示例而非正式工程图纸生产。因此属于明显的描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

整体上,代码与“国标工程图/CAD 图纸生成”这一核心用途是匹配的:它确实生成正式图框、标题栏、技术说明、图例、尺寸标注、引线标注、中心线,并输出 CAD 相关文件。然而存在实质性描述-行为差异。最主要的是,描述明确承诺“三格式交付(PDF+DXF+DWG)”以及“.dwt CAD 模板”能力,但代码只调用 reportlab/fitz/ezdxf 生成 PDF、预览 PNG 和 DXF,没有任何 DWG 或 DWT 输出逻辑。因此这是未兑现的核心能力声明。另一个较小差异是描述强调 A3 图框,而代码实际会在 A4~A0 之间自动选图幅,这更像行为扩展而非严重问题,但也说明描述不够准确。综上,应判定为存在 mismatch,主要原因是缺失 DWG 与 DWT 这两项声明能力。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

该代码的核心逻辑是对由多个圆柱体组成的三维场景进行正等轴测投影,并通过逐点深度比较执行隐藏线剔除,然后将可见线段绘制到PDF,并额外栅格化成PNG,且可选导出2D投影DXF。这与声明中的“按GB/T生成正式工程图纸与CAD模板”存在明显偏差。声明强调的是国标制图规范工作流与工程图交付要素(图框、标题栏、尺寸标注、字体、比例、技术说明、图例、DWG等),而代码没有实现这些要素,甚至没有尺寸标注或模板构建逻辑。尽管代码输出PDF和DXF,属于CAD/图形相关 supporting detail,但其主要用途是特定几何场景的可视轮廓计算与绘制,不是宣称的正式国标工程制图工作流,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill includes OS-level administrative repair commands such as stopping services, deleting font caches, and running SFC/DISM, which are unrelated to normal drawing generation and can materially alter a host system. In an agent context, such instructions can lead to privileged system modification, service disruption, or unintended damage if executed automatically or by a trusting operator.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill omits a clear warning that it includes administrative and system-modifying commands, despite documenting service control, cache deletion, and OS repair operations. In a security-sensitive agent environment, undisclosed privileged actions are dangerous because users may invoke the skill expecting harmless CAD generation, not host remediation steps.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This code path downloads and executes a third-party AppImage via extraction and AppRun without any visible integrity or authenticity verification in this script. That creates a direct remote-code-execution and supply-chain compromise risk: if the fetched artifact or its source is compromised, the host running the skill will execute attacker-controlled code.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/dxf2dwg.sh (reported line 25)May include surrounding context.

sh
}
[ -d "$OUT" ] || mkdir -p "$OUT"
if [ -f "$IN" ]; then
  tmpi="$OUT/.dxfin"; rm -rf "$tmpi"; mkdir -p "$tmpi"; cp "$IN" "$tmpi/"
  xvfb-run -a "$ODA" "$tmpi" "$OUT" "$VER" DWG 0 1 "*.dxf"
  rm -rf "$tmpi"
else

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README documents automatic download of an external binary converter without a prominent warning about network activity, trust implications, provenance verification, or the security impact of executing downloaded code. In an agent skill context, this can lead users or automation to fetch and run third-party software implicitly, expanding the supply-chain attack surface.

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 · README.md (reported line 32)May include surrounding context.

pip install ezdxf reportlab pymupdf

仅当你需要产出 DWG 时(无头 Linux 需虚拟显示)

sudo apt-get install -y xvfb # Debian/Ubuntu

text

## 三、快速开始(命令行)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation presents the output pipeline as local CAD generation, but explicitly states that DWG conversion '首次自动下载 82MB' and elsewhere that ODA is '首次转换时自动下载'. That introduces network behavior beyond straightforward local drawing generation, which is a meaningful behavior expansion relative to the claimed CAD-generation workflow.

Content

No source excerpt is available for this finding.

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.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documentation clearly includes shell-capable behavior such as running bash scripts, invoking converters, and using system utilities, but it declares no corresponding tool scope or permissions boundary. This creates a least-privilege failure: downstream agents may execute broader system actions than users would reasonably expect from a CAD drawing skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The "When to use" description includes triggers like "画图框/标题栏/尺寸标注" and "正式工程制图", which are broad phrases that could overlap with many ordinary drafting or document-formatting requests. The file does not provide negative examples or explicit constraints clarifying when the skill should not activate outside GB/T engineering drawing scenarios.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The DWG conversion flow depends on shell execution and GUI-automation helpers like xvfb-run, which broadens the runtime attack surface beyond the declared purpose. Even without obvious malicious payloads, this creates opportunities for command misuse, environmental abuse, and execution of auxiliary tooling not expected in a narrowly scoped drawing skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documents automatic downloading of an external converter binary during DWG conversion, which introduces unpinned third-party code into execution flow. Auto-fetching binaries expands the trust boundary and can enable supply-chain compromise, unexpected network access, or execution of unreviewed code in environments that only expected local CAD generation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description does not clearly warn users that DWG conversion may trigger automatic external downloads. Lack of disclosure undermines informed consent and increases the chance that an agent performs network access and code retrieval in environments where such behavior is prohibited or tightly controlled.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The script instructs users to run npx --yes clawhub without pinning an exact package version, which means the command will fetch and execute whatever version is current at runtime. If the upstream package is compromised, typosquatted, or publishes a malicious update, this becomes a remote code execution path on the maintainer's machine during release operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring is entirely in Chinese and the tool's user-facing messages are also Chinese, which imposes a specific language on all users. The file does not offer a language choice or explain that the skill is intentionally limited to a Chinese-language or region-specific workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script silently bootstraps an external binary at runtime and then prepares it for execution, which introduces a supply-chain trust boundary not obvious from the skill’s drafting purpose. In a CAD workflow, automatic retrieval of a converter may be functionally relevant, but downloading executable code during normal operation is still dangerous because it can lead to execution of tampered or unexpected software.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script gives only a minimal progress message and no meaningful warning or consent step before downloading and executing external software. That weakens user awareness and operational control, increasing the likelihood that an operator unknowingly triggers risky network access and code execution in environments where such behavior is prohibited or unsafe.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill manifest describes formal drawing/template workflows with '三格式交付(PDF+DXF+DWG)' and CAD template generation, but this file only creates a PDF and saves a DXF. No DWG generation or template (.dwt) output appears in the implementation, so the file's actual behavior falls short of the stated delivery scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The docstring states that 'poly_contains' uses a ray-casting method to determine whether a point is inside a polygon, but the function ignores the computed 'inside' value and always returns True. This is a direct contradiction between the inline documentation and the implemented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language docstring and user-facing output strings are entirely in Chinese, and the rendered PDF title/notes are also fixed to Chinese text. This imposes a specific language choice without offering the user a language/locale option or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.