Back to skill

Security audit

施工工期编排 · 从合同节点到日周月计划

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this construction-planning skill suspicious because it reports a confirmed arbitrary-code-execution path when previewing workbooks, alongside other safety and planning-integrity concerns; some analysis was incomplete.

The verdict is suspicious, so consider whether the workbook preview and planning features are worth the reported risks before installing. In particular, avoid previewing untrusted workbooks in an environment with sensitive files or credentials, and account for incomplete scanner coverage; the verdict does not establish malicious intent.

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

Error
Location
scripts/xlsx_preview.py:216
Finding

Workbook conditional-formatting expressions can execute arbitrary Python code

Content
View full analysis

Impact

A malicious workbook can execute commands with the preview process's permissions, enabling access to local files and credentials, unauthorized file modification, or network transmission. These are exploitation consequences, not evidence that this project currently performs those actions.

Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (37)

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

md
| 出图 | `network_diagram.py` `zebra_net.py` `aon_diagram.py` `aon_edit.py` `aoa.py` `progress_front.py` `resource_plan.py` `gantt_excel.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 769)May include surrounding context.

md
- `scripts/test_drag_html.js`:拖拽页的 JS 行为测试(`node scripts/test_drag_html.js 拖拽页.html`)

eval() call detected

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

An attacker-supplied workbook can cause Python expressions to execute during conditional-format rendering. Empty builtins does not provide isolation: exposed Python functions such as today allow attribute access to function globals and recovery of capabilities outside the intended namespace, potentially enabling file access or process execution with the previewer's permissions.

Content

Scanner excerpt · scripts/xlsx_preview.py (reported line 216)May include surrounding context.

python
if code is None:
            continue
        try:
            if not eval(code, _make_ns(ws, r, c, r1, c1)):   # noqa: S307 受限命名空间
                continue
        except Exception:
            continue                                          # 空值比较等,视为不命中

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 preview workflow disables Chrome's sandbox without warning about the security implications.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

The preview command explicitly disables Chrome's sandbox, removing an important containment layer when rendering HTML derived from potentially untrusted project documents. If malicious content reaches the preview or exploits the renderer, the disabled sandbox increases the potential consequences; local-file rendering does not itself make the content trustworthy.

Content

No source excerpt is available for this finding.

Generic planning and chart terms are listed as triggers without a construction-specific activation constraint.

Medium
Category
Trigger Abuse
Confidence
98% confidence
Finding

The trigger list includes broad terms such as 年计划/月计划/周计划/日报 (L08), 柱状图 (L18), 进度对比 (L23), and 削峰 (L27), which also occur in ordinary business planning, visualization, and other technical domains. Although the surrounding list suggests construction scheduling, it does not require that context or provide exclusions, so these terms could cause unrelated requests to invoke the skill.

Content

No source excerpt is available for this finding.

The warning drill reports success even when its checks find that required warning colors never appeared.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

demo() records missing required warning colors as errors beginning with '演练后未出现', but main() treats only messages beginning with '第' as failures. Consequently, a drill missing required warning categories can exit successfully and claim all three colors were triggered, undermining the construction-progress warning validation gate.

Content

No source excerpt is available for this finding.

The documented evidence allowlist is not enforced when aggregating CAD quantities.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The bridge promises to aggregate only confirmed_evidence and inferred_candidate entries, but its acceptance condition checks only the review bucket, review_required flag, and presence of a quantity. Untrusted contract entries with missing or disallowed evidence status can therefore enter planning totals, potentially distorting durations and resource estimates; the non-settlement disclaimer does not protect planning integrity.

Content

No source excerpt is available for this finding.

Tainted flow: 'out' from open (line 664, file read) → open (file write)

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

python
f'<LinkLag>{lag10}</LinkLag><LagFormat>7</LagFormat></PredecessorLink>')
        x.append('</Task>')
    x.append('</Tasks></Project>')
    with open(out, "w", encoding="utf-8") as f:
        f.write("\n".join(v for v in x if v))
    return len(nodes)

Tainted flow: 'out' from open (line 668, file read) → open (file write)

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

python
def csv_out(ctx, out, detail=False):
    tasks = ctx["tasks"] if detail else ctx["folded"]
    ordered = [t for _, _, items in grouped(tasks, ctx["tpl"]) for t in items]
    with open(out, "w", encoding="utf-8-sig", newline="") as f:
        w = csv.writer(f)
        w.writerow(["序号", "任务编号", "WBS", "工作名称", "类别", "节点级别", "工期(工作日)",
                    "紧前工作", "计划开始", "计划完成", "总时差", "自由时差", "关键工作",

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

python
"--xlsx", os.path.splitext(out_svg)[0] + "-六参数表.xlsx"]
    if tpl_path:
        cmd += ["--template", tpl_path]
    subprocess.run(cmd, check=True, capture_output=True)
    return out_svg

Tainted flow: 'cmd' from open (line 600, 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/export_formats.py (reported line 604)May include surrounding context.

python
"--xlsx", os.path.splitext(out_svg)[0] + "-六参数表.xlsx"]
    if tpl_path:
        cmd += ["--template", tpl_path]
    subprocess.run(cmd, check=True, capture_output=True)
    return out_svg

The exported Gantt views contain independent snapshots, contradicting the documented automatic linkage to edits in the task sheet.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The task sheet, chart calculation sheet, and conditional-formatting sheets contain separate copies of task data rather than references to a shared editable source. Despite promises of automatic linkage, editing the task sheet leaves the Gantt views stale, creating a planning-integrity risk when those views are used for construction coordination or reporting; this is not a code-execution vulnerability.

Content

No source excerpt is available for this finding.

Successful reader installation overrides the requirement to stop when neither quantities nor drawings are available.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

When neither sufficient quantities nor drawings are present, the code correctly sets ok to false, but discovering the reader after installation unconditionally changes it to true. Consequently, --need quantity --install can return success and announce readiness despite missing essential project inputs, bypassing the prerequisite gate that downstream automation may rely on.

Content

No source excerpt is available for this finding.

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

python
cmd = ["skillhub", "install", "cad-file-reader",
                   "--namespace", "user_43faedd6", "--dir", SKILLS]
            print("执行:" + " ".join(cmd))
            r = subprocess.run(cmd, capture_output=True, text=True)
            print((r.stdout or "") + (r.stderr or ""))
            reader, rver = find(READER_CANDIDATES)
            res["reader"] = {"path": reader, "version": rver}

C2 claims to validate view-to-ledger consistency but compares ledger-derived values with the same ledger.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

C2 obtains each view's dates directly from ledger rows and compares them with those same rows, making the consistency check tautological for valid unique task IDs. Consequently, altered or incorrectly generated downstream plan artifacts can remain unchecked while this tool reports consistency, undermining the planning-integrity assurance it explicitly provides.

Content

No source excerpt is available for this finding.

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

python
# 提前量/收尾量:日期必须是台账日期加减 offset(日历天),一格都不能飘
        if x["at"] in ("提前量", "收尾量"):
            base = r["ps"] if x["at"] == "提前量" else r["pe"]
            want = (d(base) + __import__("datetime").timedelta(days=x["offset"])).isoformat()
            if x["date"] != want and not x.get("clamped"):
                nb.append(f"{x['nid']} {x['name']}:应为 {base}{x['offset']:+d}天={want},实为 {x['date']}")
    ck("C6", not nb,

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

python
with open(sw, "w", encoding="utf-8") as f:
        f.write(SWIFT_OCR)
    try:
        r = subprocess.run(["swift", sw, path], capture_output=True,
                           text=True, timeout=180)
    except FileNotFoundError:
        raise RuntimeError("找不到 swift,OCR 必须用 macOS 自带 Vision;"

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

python
for k, t in enumerate(order):
        t["row"] = k
    nodes, arrows, ainfo = aoa.build(order, tc)
    txt, stat = __import__("zebra_net").render(
        order, tc, {}, d0, groups=False, legend=True, nodes=nodes, arrows=arrows,
        ainfo=ainfo, sheet_note="由横道图图片识别,紧前关系为推断值,须人工确认")
    with open(path, "w", encoding="utf-8") as f:

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

python
def _run(label, args, quiet=False):
    r = subprocess.run([PY] + args, capture_output=True, text=True)
    if r.returncode != 0:
        print(f"✗ {label} 失败(退出码 {r.returncode})", file=sys.stderr)
        for line in (r.stdout + r.stderr).strip().splitlines()[-6:]:

Expert-review dates are calculated seven days before scheme completion, contradicting the documented seven days before construction starts.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The plan_scheme docstring at L195–L198 says expert review finishes seven days before the corresponding construction activity starts. However, L231–L232 subtract the scheme's lead time first and then another seven days; a 30-day lead therefore produces an expert-review date 37 days before construction. These dates are written into the generated plan's expert-review field, materially changing its declared scheduling rule.

Content

No source excerpt is available for this finding.

Material specifications are prefilled with fixed technical choices despite documentation assigning specification entry to project personnel.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The material plan exports concrete technical specifications without deriving them from approved drawings or marking those cells as unconfirmed examples. In a construction-planning workflow, these authoritative-looking entries could be mistaken for approved procurement requirements, despite documentation assigning specification selection to project personnel.

Content

No source excerpt is available for this finding.

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

python
def _run(args, cwd=HERE):
    r = subprocess.run([PY] + args, capture_output=True, text=True, cwd=cwd)
    return r.returncode, (r.stdout or "") + (r.stderr or "")

The error-handling requirement mandates Chinese output without offering a language choice.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The docstring requires invalid-input errors to be presented as “一句中文” (one sentence in Chinese). This explicitly prescribes an output language without user opt-in or a documented justification for the language restriction.

Content

No source excerpt is available for this finding.

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

python
"--html", html])
    if rc != 0:
        return False, o.strip()[:200]
    r = subprocess.run([node, os.path.join(HERE, "test_drag_html.js"), html],
                       capture_output=True, text=True)
    out = (r.stdout or "") + (r.stderr or "")
    if r.returncode != 0: