Back to skill

Security audit

Semantic Creator — Interface to Governed Semantic Layer (Meta-Skill)

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent, but its generated local review HTML can run injected script if untrusted interface text is embedded unsafely.

Install only if you are comfortable reviewing or patching the HTML generation path first. The model JSON should be HTML-safely encoded before insertion, or stored outside the script element, and generated reports should be opened only from trusted input until that is fixed.

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
assets/review-template.html:141
Finding

Unescaped Model JSON Embedding Enables Stored Script Injection

Content
View full analysis
``` The corresponding generation instructions are: ```markdown 不要手写报告 HTML。生成 JSON,替换 `assets/review-template.html` 中的 `/*__MODEL_JSON__*/`,写入 `$TMPDIR/semantic-review-.html`。 模板离线自足,无 CDN、无网络。 ``` The embedded data is subsequently parsed as JSON: ```javascript function App(){ var model = JSON.parse(document.getElementById('model').textContent); var decisionMap = {}; var modelErrors = []; ``` ### Technical Analysis A `script` element is terminated by the HTML parser when it encounters the character sequence ` ``` and the generated JSON is substituted into the placeholder without HTML-safe escaping, the first sequence closes the JSON container. The following `script` element is then interpreted and executed as active JavaScript when the reviewer opens the generated report. The later use of `textContent` and `JSON.parse` does not prevent this issue because script termination occurs during initial HTML parsing, before the application reads the element. ### Attack Path 1. An attacker supplies or modifies an API description, CLI description, schema documen ...[truncated 1633 chars]
Remediation
View remediation
/g, '\\u003e') .replace(/&/g, '\\u0026') .replace(/\u2028/g, '\\u2028') .replace(/\u2029/g, '\\u2029'); ``` Only the resulting `safeJson` value should replace `/*__MODEL_JSON__*/`. 2. **Prefer a representation that cannot terminate an HTML element.** For example, Base64-encode the UTF-8 JSON payload during generation and decode it before `JSON.parse`, or load a separately generated JSON file under an explicitly controlled local workflow. 3. **Add a strict Content Security Policy.** Refactor inline executable scripts to use hashes or nonces, then apply a policy such as: ```html ``` `connect-src 'none'` is particularly appropriate for a report documented as fully offline. CSP should be defense in depth rather than a replacement for safe encoding. 4. **Document the encoding requirement in `references/review.md`.** The generation instructions should explicitly prohibit raw JSON substitution and provide a canonical safe serialization procedure. 5. **Add regression tests** using model values containing: ```text
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
`assets/review-template.html`,由用户确认、选择、修正、补证或拒绝;反馈写入

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest says to use the skill when users request 'semantic layers, dimensional models, ontology, OKF' and similar Chinese phrases, but it does not define specific trigger phrases, exclusions, or negative examples. Terms like 'ontology' are broad and could overlap with general discussion rather than a clear request to invoke this skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document declares lang="zh-CN", and the interface text throughout the template is primarily Chinese, which imposes a specific language/locale on all users. The file does not offer any language selection or explain that the skill is intended only for a Chinese-specific context, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s operational instructions and required output conventions are written entirely in Chinese and present the behavior as the default target, with no indication that users may select another language. This is a natural-language locale/language constraint and matches the policy category for forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill file is written as mandatory Chinese-language guidance, including field descriptions and generation instructions, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file's operational instructions are entirely in Chinese, which can force a specific language on users or downstream agents without opt-in. The policy allows locale constraints only when they are explicitly offered as a choice or clearly justified as region-specific, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill content is primarily written in Chinese and includes Chinese-only section headings and guidance, which effectively forces a specific language/locale without explicit user opt-in. In a multilingual agent setting, this can cause misunderstanding of security-relevant modeling decisions, reduce user ability to review or approve outputs accurately, and create consent/usability issues around critical approval gates.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The entire verification procedure is written in Chinese, including operational instructions and escalation guidance, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking context. This can violate language/locale policy because it imposes a specific language by default rather than by opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The Phase 3 description states that the skill generates bundles/YAML and that output files are '落盘' (written to disk), but the markdown does not explicitly warn users that running the skill will create or modify files in the repository. Because markdown files should disclose behaviors affecting user data or system state, this file-writing behavior should be called out clearly.

Content

No source excerpt is available for this finding.