Back to skill

Security audit

Gradient

Security checks for vulnerabilities and agentic risk

Overview

This gradient tool is purpose-aligned overall, but it has review-worthy file overwrite and unsafe generated-preview risks.

Review before installing. Use only trusted gradient names and CSS values, avoid opening or sharing generated preview HTML from untrusted records, and choose export or preview output paths carefully because existing files can be overwritten. The skill stores saved gradients locally in ~/.gradient/data.jsonl, and deletion removes records from that store.

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

Warning
Location
scripts/script.sh:374
Finding

Stored HTML Injection and Cross-Site Scripting in Generated Gradient Previews

Content
View full analysis
{name}
{css}
''') html = f''' Gradient Preview body {{ font-family: -apple-system, sans-serif; background: #111; color: #eee; padding: 2rem; }} h1 {{ text-align: center; }} .grid {{ display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }} .card {{ border-radius: 12px; overflow: hidden; background: #222; }} .swatch {{ height: 160px; }} .info {{ padding: 1rem; font-size: 0.85rem; }} code {{ color: #8be9fd; word-break: break-all; }}

Gradient Preview ({len(records)} gradients)

{"".join(cards)}
''' ``` ### Technical Analysis Gradient names and CSS definitions originate from command-line input and are persisted in `~/.gradient/data.jsonl`. The preview command retrieves these values and inserts them directly into an HTML document without context-sensitive encoding. The `name` value is inserted into an HTML element body: ```html {name} ``` Consequently, an attacker-controlled name containing HTML elements or event-handler attributes is interpreted as executable markup instead of text. The generated CSS is inserted into both an HTML attribute and an element body: ```html
{css} ``` Because colors and other gradient components are not validated against strict CSS grammars, specially crafted input can include quotat ...[truncated 2206 chars]
Remediation
View remediation
` and `` content, but it is not a substitute for validating a CSS declaration placed in an attribute. Prefer generating a safe class or validated CSS rule rather than interpolating arbitrary text into `style`. 4. **Consider generating the document with safe DOM APIs.** If client-side rendering is used, assign untrusted values through `textContent`, not `innerHTML`, and set only validated style properties. 5. **Add a restrictive Content Security Policy as defense in depth.** Avoid inline event handlers and consider a policy such as: ```html ``` This should supplement, not replace, proper encoding and validation. 6. **Validate existing persisted records.** Older records in `~/.gradient/data.jsonl` may already contain malicious values. Validate or safely encode them whenever previews are generated, even after input validation is added to creation and update commands. 7. **Add regression tests** covering name ...[truncated 276 chars]
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documents commands that read and write local files (~/.gradient/data.jsonl, export output files, preview HTML generation) but does not declare any tool scope or permissions boundary. In an agent setting, this can cause the model or user to invoke file-capable behavior without clear authorization, increasing the risk of unintended file access or writes.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

The skill intentionally stores gradient definitions for reuse, creating session persistence across runs. While the stored content appears low sensitivity, persistent local state can still leak naming conventions, project details, or user-provided data and may influence later behavior in ways users do not expect.

Content

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

md
# Gradient — CSS Gradient Generator & Palette Builder

Generate production-ready CSS gradient code for linear, radial, and conic gradients. Create gradient palettes, preview combinations, adjust angles and color stops, and export gradient collections. All gradient definitions are stored locally in JSONL format for reuse and sharing.

## Prerequisites

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented delete command removes stored gradients by ID but provides no warning, confirmation, or recovery guidance. In practice this can lead to accidental data loss, especially in agent-driven or scripted use where destructive commands may be issued with incomplete user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The delete command permanently removes saved gradient records from the data file, but the code provides no confirmation prompt, cautionary comment, or other user-facing warning before performing the deletion. Although it prints the result afterward, that is not a disclosure prior to the destructive action.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill explicitly states that records are stored locally and that export/preview commands write files, but it does not present a user-facing persistence warning. This is risky because users may assume the tool is stateless while it actually leaves artifacts on disk, which can expose project names, metadata, or generated content to later sessions or other local users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The export command writes to a user-controlled output path without restriction or confirmation, which can overwrite arbitrary files writable by the current user. In an agent-driven context, untrusted parameters could redirect output to sensitive shell startup files, project configs, or other important paths, causing data loss or persistence-adjacent abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The preview command similarly writes to an arbitrary user-specified path and generates HTML containing unescaped gradient names and CSS values from stored records. This creates two risks in an agent context: arbitrary file overwrite and potentially unsafe HTML/script injection into the generated preview if record contents are attacker-controlled.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.