Back to skill

Security audit

Engineering Document Pre-Review

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent local engineering-document review tool, but its generated Excel output can carry untrusted spreadsheet formulas and it writes sensitive extracted content by default.

Install and run this only in an isolated environment and choose a private output directory. Use --no-excel for documents from untrusted parties unless formula escaping is added, and use --skip-extracted-text when full extracted source text is not needed. Treat generated reports as sensitive because they may contain names, phone numbers, customer data, schedules, quantities, and contract-relevant details.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/review_engineering_doc.py:501
Finding

Untrusted document values can trigger spreadsheet formula injection

Content
View full analysis
None: if Workbook is None: raise RuntimeError( "生成 Excel 需要 openpyxl。请运行:python -m pip install openpyxl" ) wb = Workbook() ws = wb.active ws.title = "字段" ws.append(["分组", "字段", "值"]) def append_group(prefix: str, value: Any) -> None: if isinstance(value, dict): for key, child in value.items(): append_group(f"{prefix}.{key}" if prefix else key, child) elif isinstance(value, list): ws.append([prefix, "", json.dumps(value, ensure_ascii=False)]) else: group, _, key = prefix.rpartition(".") ws.append([group, key or prefix, value]) ``` ### Technical Analysis The application extracts values from untrusted DOCX, PDF, XLSX, and XLSM documents and writes those values directly into a generated Excel workbook. The scalar `value` passed to `ws.append()` is not validated or escaped. Spreadsheet applications can interpret strings beginning with `=`, `+`, `-`, or `@` as formulas. An attacker who controls an input document can therefore place a formula-prefixed payload in a field that the parser extracts. The resulting `fields.xlsx` workbook will contain the attacker-controlled formula rather than an inert text value. The payload is not evaluated by the Python parser itself. Exploitation occurs when a reviewer opens the generated workbook in a spreadsheet application, and the precise behavior depends on that application's formula support and security settings. ### Attack Path 1. An attacker supplies an engineering document containing a value such as a project name or other recognized field that begins with a spreadsheet formula character. 2. The parser reads that value and st ...[truncated 1159 chars]
Remediation
View remediation
Any: if not isinstance(value, str): return value dangerous = value.lstrip().startswith(("=", "+", "-", "@")) return "'" + value if dangerous else value # Apply to all untrusted values written to cells. ws.append([ safe_excel_text(group), safe_excel_text(key or prefix), safe_excel_text(value), ]) ``` For stronger guarantees, create cells explicitly and set their data type to text after sanitization. ]]>

T08 · Insecure Dependencies

Note
Location
scripts/requirements.txt:1
Finding

Mutable dependency ranges permit unreviewed package versions

Content
View full analysis
=1.1,<2 openpyxl>=3.1,<4 pdfplumber>=0.11,<1 ``` The documented installation command is: ```bash python -m pip install -r /scripts/requirements.txt ``` ### Technical Analysis The dependency file uses broad version ranges rather than exact, reviewed versions and does not provide integrity hashes. As a result, identical installation commands executed at different times can install different dependency releases. The package names are recognizable, and the audited project does not specify an obviously unsafe package source. However, the current configuration delegates version selection and artifact integrity to the configured package index at installation time. A future vulnerable release, compromised package publisher, compromised index, or poisoned package mirror could therefore introduce code that was not included in this audit. Python packages may execute build or installation logic during installation. They also execute in the application's process when imported and used to parse untrusted documents. ### Attack Path 1. A user follows the documented installation command. 2. `pip` resolves the newest package versions allowed by the mutable ranges. 3. A compromised, malicious, or unexpectedly vulnerable release is selected from the configured package index or mirror. 4. Package-controlled code executes during installation, import, or document processing. 5. That code runs with the privileges of the user who installed or invoked the Skill. This path requires an upstream package, account, index, or mirror compromise, or the publication of an unsafe version that remains within an allowed range. ### Impact Assessment The dependencies run with the same operating-system privileges as t ...[truncated 529 chars]
Remediation
View remediation
\ --hash=sha256: openpyxl== \ --hash=sha256: pdfplumber== \ --hash=sha256: ``` The actual versions and hashes should be generated from reviewed artifacts rather than copied from an unverified source. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs the agent to install dependencies and run a local parser that writes multiple artifacts to disk, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch weakens least-privilege controls because an agent runtime may permit broader file-write behavior than the user expects, especially when handling sensitive engineering documents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The user-facing metadata is in Chinese, but the default prompt hard-codes English instructions, which may force a language choice without user opt-in. This creates a natural-language policy concern because the skill does not explicitly offer the user a language or locale choice or justify the mismatch.

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.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script automatically writes extracted full text, phone numbers, names, and review summaries to local files in cleartext without minimization, masking, or an explicit consent/control gate beyond optional flags. Because the skill is designed to process engineering documents that may contain sensitive project data and personal contact information, this creates a realistic data exposure risk if output directories are shared, synced, backed up, or accessed by other local users/processes.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest provides a display name, description, and default prompt, but does not specify when the skill should activate or what exact user requests should invoke it. Without explicit trigger phrases, scope limits, or exclusion conditions, invocation behavior may be overly broad or ambiguous in systems that rely on manifest text for routing.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: python-docx has 2 known advisory(ies) (CVE-2016-5851 (Improper Restriction of XML External Entity Reference in python-docx); CVE-2016-5851 (python-docx before 0.8.6 allows context-dependent attackers to conduct XML Exter)), 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

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

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

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains multiple natural-language strings that force Chinese-language interaction, beginning with dependency error messages and continuing throughout CLI descriptions and output. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.