Back to skill

Security audit

custom-ui-spec

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent UI design-spec helper with a local validator; the main caution is that some bundled demo pages contain unsafe example JavaScript and should not be hosted on a privileged origin.

Before installing, treat this as a local UI design and validation helper. It is reasonable to use for code generation or review, but do not deploy the bundled demo HTML pages on the same origin as authenticated or sensitive applications unless the unsafe innerHTML filename rendering 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
example/demo-apple-hig.html:1797
Finding

DOM-based cross-site scripting through an uploaded filename in the Apple HIG demo

Content
View full analysis
${f.name}${size}×`; list.appendChild(item); } event.target.value = ''; } ``` ### Technical Analysis `File.name` is attacker-influenced data. The application interpolates it directly into an HTML template and assigns the resulting string to `innerHTML`. The browser consequently parses the filename as markup rather than displaying it exclusively as text. A filename containing an HTML element with an event handler, such as: ```text .txt ``` can create an executable element when selected in a browser or operating-system environment that permits such filename characters. The `onerror` handler runs immediately after the broken image is parsed. The file's contents do not need to be uploaded or read. Merely selecting a file with a malicious name is sufficient to reach the vulnerable sink. ### Attack Path 1. An attacker creates or distributes a file whose filename contains an HTML injection payload. 2. The victim opens the Apple HIG demonstration page. 3. The victim selects the attacker-supplied file through the upload component. 4. `handleUpload()` obtains the malicious name from `f.name`. 5. The filename is interpolated into a templa ...[truncated 1011 chars]
Remediation
View remediation
item.remove()); item.append(name, fileSize, removeButton); list.appendChild(item); } event.target.value = ''; } ``` Additional hardening should include: - Avoid inline event handlers so a strict Content Security Policy can be applied. - Configure CSP without `unsafe-inline`, using nonces or external scripts as appropriate. - If HTML rendering is genuinely required elsewhere, use a maintained allowlist-based sanitizer; HTML escaping alone is preferable when only text is expected. - Add a regression test using filenames containing HTML metacharacters and verify that they are displayed literally without creating DOM elements. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
example/demo-google-material.html:1885
Finding

DOM-based cross-site scripting through uploaded or dropped filenames in the Material demo

Content
View full analysis
`
${f.name} (${(f.size/1024).toFixed(1)} KB) ×
` ).join(''); } ``` ### Technical Analysis `handleFiles()` stores each browser-provided `File.name` without validation or contextual encoding. `renderUploadList()` subsequently interpolates the stored filename into an HTML string and assigns the combined output to `innerHTML`. Because the filename is interpreted in an HTML context, a malicious name can terminate the intended text context and insert arbitrary elements or event attributes. For example: ```text .txt ``` The drag-and-drop handler provides an additional path to the same vulnerable function. No file-content processing or server-side upload is necessary for exploitation. ### Attack Path 1. An attacker supplies the victim with a file having a crafted HTML-bearing filename. 2. The victim selects or drags the file onto the Material demo upload area. 3. `handleFiles()` copies the malicious `f.name` into `uploadedFiles`. 4. `renderUploadList()` inserts that value into an HTML template. ...[truncated 903 chars]
Remediation
View remediation
{ const item = document.createElement('div'); item.className = 'upload-file-item'; const description = document.createElement('span'); description.textContent = `${file.name} (${(file.size / 1024).toFixed(1)} KB)`; const removeButton = document.createElement('button'); removeButton.type = 'button'; removeButton.textContent = '×'; removeButton.setAttribute('aria-label', `Remove ${file.name}`); removeButton.addEventListener('click', () => removeUploadFile(index)); item.append(description, removeButton); list.appendChild(item); }); } ``` Further hardening measures: - Treat every `File` property as untrusted display data. - Remove inline `onclick` handlers and attach listeners with `addEventListener`. - Deploy a strict Content Security Policy that excludes `unsafe-inline`. - Keep example applications on an origin isolated from authenticated production services. - Add automated tests covering file selection and drag-and-drop with names containing `<`, `>`, quotes, ampersands, and event-handler payloads. - Review the other `innerHTML` assignments in the demo and ensure only fixed, trusted values reach them. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (22)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Run `scripts/validate_ui.py` for automated validation

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Run `scripts/validate_ui.py` for automated validation

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Run `scripts/validate_ui.py` for automated validation

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
4. Run `scripts/validate_ui.py` for automated validation

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `references/apple-hig.md` | When HIG spec is selected |

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 970)May include surrounding context.

html
</head>
<body>
  <div class="app-shell">
    <!-- Sidebar -->
    <aside class="sidebar">
      <div class="sidebar-header">
        <div class="logo"><span class="logo-icon"></span> ProjectHub</div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1021)May include surrounding context.

html
<!-- Main -->
    <div class="main-area">
      <!-- Breadcrumb -->
      <div class="breadcrumb">
        <a href="#">Home</a>
        <span class="breadcrumb-sep">/</span>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1081)May include surrounding context.

html
</div>
        </div>

        <!-- Pivot Tabs + Recent Tasks -->
        <div class="section-block">
          <div class="section-header">
            <h2>Recent Tasks</h2>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1187)May include surrounding context.

html
</div>
        </div>

        <!-- Data Grid -->
        <div class="section-block">
          <div class="section-header">
            <h2>Team Members</h2>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1340)May include surrounding context.

html
</div>
        </div>

        <!-- 6. Pagination -->
        <div class="comp-section">
          <div class="comp-section-title">6. Pagination</div>
          <div class="comp-demo">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1457)May include surrounding context.

html
</div>
        </div>

        <!-- 11. Timeline -->
        <div class="comp-section">
          <div class="comp-section-title">11. Timeline</div>
          <div class="comp-demo">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1579)May include surrounding context.

html
</div>
        </div>

        <!-- 14. Space / Stack -->
        <div class="comp-section">
          <div class="comp-section-title">14. Space / Stack</div>
          <div class="comp-demo">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · example/demo-microsoft-fluent.html (reported line 1652)May include surrounding context.

html
</div>
        </div>

        <!-- 18. SearchBar -->
        <div class="comp-section">
          <div class="comp-section-title">18. SearchBar</div>
          <div class="comp-demo">

Undeclared Tool Scope

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The entire skill content is written as prescriptive guidance in English and does not indicate any user language or locale choice, opt-in, or region-specific justification. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern applicable to all file types.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/interaction-guidelines.md (reported line 207)May include surrounding context.

md
| Delete single item | Action Sheet confirmation | Dialog confirmation | Snackbar + Undo (recommended) |
| Delete multiple items | Alert confirmation | Dialog confirmation | Dialog confirmation |
| Discard unsaved content | Alert confirmation | Dialog confirmation | Dialog confirmation |
| Submit/Send | No confirmation | No confirmation | No confirmation |
| Mark/Categorize | No confirmation | No confirmation | No confirmation |
| Irreversible operation (clear) | Alert confirmation (red button) | Dialog confirmation (red button) | Dialog confirmation (error color) |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/interaction-guidelines.md (reported line 208)May include surrounding context.

md
| Delete single item | Action Sheet confirmation | Dialog confirmation | Snackbar + Undo (recommended) |
| Delete multiple items | Alert confirmation | Dialog confirmation | Dialog confirmation |
| Discard unsaved content | Alert confirmation | Dialog confirmation | Dialog confirmation |
| Submit/Send | No confirmation | No confirmation | No confirmation |
| Mark/Categorize | No confirmation | No confirmation | No confirmation |
| Irreversible operation (clear) | Alert confirmation (red button) | Dialog confirmation (red button) | Dialog confirmation (error color) |

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The HTML root sets lang="en", which hard-codes the interface language/locale to English in a file that otherwise contains internationally neutral demo content. Under the policy, locale-specific behavior should either offer user choice or be explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly sets lang="en", which signals a fixed language choice in natural-language UI content. The file does not offer localization options or explain why English-only behavior is required, which conflicts with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This HTML file declares lang="en", and the visible interface text throughout the page is English-only. Under the policy rule for natural-language constraints, forcing a specific language without user opt-in or justification can violate locale-choice expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The report template hard-codes the inspector value as "Agent," and the overall checklist is written in English-specific terminology and labels without indicating that users may choose another language or locale. Under the stated policy, forcing a specific language/locale convention without opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Line L0129 specifies 'Noto Sans (Chinese)', which imposes a locale-specific font choice in natural language without indicating that users may choose another language or typography preference. Under the policy, locale constraints should either be optional or explicitly justified as region-specific.

Content

No source excerpt is available for this finding.