Back to skill

Security audit

Platonic Brainstorming

Security checks for vulnerabilities and agentic risk

Overview

The skill fits its brainstorming purpose, but its optional browser companion runs an unauthenticated local web server that can expose or log session content if used carelessly.

Review before installing. Use the visual companion only on loopback/local URLs, avoid --host 0.0.0.0 on shared or remote networks unless protected by an authenticated tunnel, and assume option clicks and visible option text may be written to the session state directory. Clean up .superpowers/brainstorm data if it contains sensitive designs, and do not run stop-server.sh against untrusted or manually edited session directories.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/server.cjs:163
Finding

Unauthenticated HTTP and WebSocket Service Can Expose Session Content

Content
View full analysis
isFullDocument(raw) ? raw : wrapInFrame(raw))(fs.readFileSync(screenFile, 'utf-8')) : WAITING_PAGE; if (html.includes('')) { html = html.replace('', helperInjection + '\n'); } else { html += helperInjection; } res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); res.end(html); } else if (req.method === 'GET' && req.url.startsWith('/files/')) { const fileName = req.url.slice(7); const filePath = path.join(CONTENT_DIR, path.basename(fileName)); if (!fs.existsSync(filePath)) { res.writeHead(404); res.end('Not found'); return; } const ext = path.extname(filePath).toLowerCase(); const contentType = MIME_TYPES[ext] || 'application/octet-stream'; res.writeHead(200, { 'Content-Type': contentType }); res.end(fs.readFileSync(filePath)); } else { res.writeHead(404); res.end('Not found'); } } const clients = new Set(); function handleUpgrade(req, socket) { const key = req.headers['sec-websocket-key']; if (!key) { socket.destroy(); return; } const accept = computeAcceptKey(key); socket.write( 'HTTP/1.1 101 Switching Protocols\r\n' + 'Upgrade: websocket\r\n' + 'Connection: Upgrade\r\n' + 'Sec-WebSocket-Accept: ' + accept + '\r\n\r\n' ); let buffer = Buffer.alloc(0); clients.add(socket); ``` ```javascript server.listen(PORT, HOST, () => { const info = JSON.stringify({ type: 'server-started', port: Number(PORT), host: H ...[truncated 2230 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/stop-server.sh:11
Finding

Untrusted Session Directory and PID File Permit Process Termination and Recursive Deletion

Content
View full analysis
"}' exit 1 fi STATE_DIR="${SESSION_DIR}/state" PID_FILE="${STATE_DIR}/server.pid" if [[ -f "$PID_FILE" ]]; then pid=$(cat "$PID_FILE") # Try to stop gracefully, fallback to force if still alive kill "$pid" 2>/dev/null || true # Wait for graceful shutdown (up to ~2s) for i in {1..20}; do if ! kill -0 "$pid" 2>/dev/null; then break fi sleep 0.1 done # If still running, escalate to SIGKILL if kill -0 "$pid" 2>/dev/null; then kill -9 "$pid" 2>/dev/null || true # Give SIGKILL a moment to take effect sleep 0.1 fi if kill -0 "$pid" 2>/dev/null; then echo '{"status": "failed", "error": "process still running"}' exit 1 fi rm -f "$PID_FILE" "${STATE_DIR}/server.log" # Only delete ephemeral /tmp directories if [[ "$SESSION_DIR" == /tmp/* ]]; then rm -rf "$SESSION_DIR" fi echo '{"status": "stopped"}' else echo '{"status": "not_running"}' fi ``` ### Technical Analysis The script treats its first argument as a trusted session directory and reads a PID from `/state/server.pid`. It does not verify that: - The directory is a session generated by `start-server.sh`. - The path is canonical and free of symlink redirection. - The PID is numeric and belongs to this visual-companion server. - The current process is the same process originally recorded in the PID file. - The deletion target follows the expected `/tmp/brainstorm--` naming pattern. The `/tmp/*` condition is excessively broad. Any argument beginning with `/tmp/` can reach `rm -rf`, rather than only directories created by this project. PID reuse also creates a time-of-check/time-of-use ...[truncated 1404 chars]
Remediation
View remediation
/cmdline`, process start time, or another platform-appropriate mechanism. Do not rely on a PID alone. 7. Refuse cleanup if ownership, mode, naming, process identity, or token validation fails. 8. Delete only known session files and directories, or use a securely created directory descriptor, instead of applying `rm -rf` to a raw caller-provided path. 9. Handle stale PID files safely and never signal a process unless its identity has been positively established. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/helper.js:45
Finding

Selection Labels Are Reinterpreted as HTML, Enabling DOM-Based Cross-Site Scripting

Content
View full analysis
{ const indicator = document.getElementById('indicator-text'); if (!indicator) return; const container = target.closest('.options') || target.closest('.cards'); const selected = container ? container.querySelectorAll('.selected') : []; if (selected.length === 0) { indicator.textContent = 'Click an option above, then return to the terminal'; } else if (selected.length === 1) { const label = selected[0].querySelector('h3, .content h3, .card-body h3')?.textContent?.trim() || selected[0].dataset.choice; indicator.innerHTML = '' + label + ' selected - return to terminal to continue'; } else { indicator.innerHTML = '' + selected.length + ' selected - return to terminal to continue'; } }, 0); ``` ### Technical Analysis The selected option label is read with `textContent`, but it is then concatenated into an `innerHTML` assignment. Reading through `textContent` does not make the value safe for subsequent HTML parsing. If the visible heading contains literal markup characters, assigning that text to `innerHTML` causes the browser to parse those characters as active markup. For example, a heading encoded in the source as the following displays an HTML-looking string as text: ```html

<img src=x onerror="alert(document.domain)">

``` Its `textContent` value is: ```html ``` When the option is selected, the helper inserts that value through `innerHTML`, creating an actual image element whose error handler executes. The companion intentionally serves agent-generated HTML, so imported, copied, or otherwise untr ...[truncated 1187 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a high-level design exploration skill, but the code is a browser-side interaction/telemetry helper for a UI. Its primary behavior is to connect to a WebSocket server, capture and send click/choice events, manage selection UI state, and respond to server messages by reloading the page. These are concrete runtime capabilities not reflected in the declared purpose, and they materially differ from a design/requirements exploration function. No permissions were declared, yet the code performs network communication and client-side event monitoring.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents the skill as a conceptual design-exploration aid with no permissions, but the supplied code actually performs operational infrastructure work: it launches a Node server, manages processes, binds to network interfaces, and writes persistent or temporary filesystem state. Those are concrete capabilities not reflected in the description and are materially different from merely exploring intent, requirements, or design. This is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a design/planning-oriented capability focused on exploring requirements and alternatives prior to implementation. The supplied code does not perform any design exploration or requirements analysis. Instead, it operationally manages a server by reading a PID file, sending termination signals, checking process status, cleaning up files, and deleting ephemeral session directories. This is a materially different primary purpose and includes undeclared capabilities related to process control and filesystem modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script opens an unsecured WebSocket connection using ws:// and queues/sends interaction events to the server without any visible notice, consent, or minimization. In a browser-based skill UI, this creates a privacy and telemetry risk because user actions may be transmitted silently and, if served over an untrusted network, can also be exposed to interception or manipulation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The click handler captures textContent, data-choice, and element IDs from clicked elements and transmits them over the socket without any visible disclosure. Even if intended for legitimate workflow coordination, this can leak sensitive or identifying UI content and user behavior, especially because the code is part of a brainstorming/design skill where clicked text may reflect user preferences, plans, or internal project details.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

User-supplied interaction events are appended to a disk file in /tmp without any evident notice, consent, retention controls, or permission hardening. Even if intended for workflow state, persisted interaction logs can capture sensitive choices or free-form fields and may be readable by other local users depending on filesystem permissions and environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a brainstorming skill focused on exploring intent, requirements, and design, but this file stands up a network-accessible server, serves HTML/JS content, watches directories, and maintains WebSocket clients. Hosting an interactive local web application is a materially broader behavior than simple design exploration logic and is not implied by the manifest text alone.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script explicitly supports binding the brainstorming server to non-local interfaces such as 0.0.0.0, making it reachable from other hosts if the environment permits. For a tool described as optional design exploration, exposing a network service broadens the attack surface and can unintentionally disclose brainstorming content or enable unauthorized interaction, especially in shared, remote, or containerized environments.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script is designed to operate in remote or containerized environments and can advertise a remotely reachable URL host, which is not clearly necessary for a local brainstorming helper. Even without obvious exploit code here, this capability increases exposure by making accidental remote availability a supported use case.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/start-server.sh (reported line 67)May include surrounding context.

sh
FOREGROUND="true"
fi

# Windows/Git Bash reaps nohup background processes. Auto-foreground when detected.
if [[ "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
  case "${OSTYPE:-}" in
    msys*|cygwin*|mingw*) FOREGROUND="true" ;;

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/start-server.sh (reported line 119)May include surrounding context.

sh
FOREGROUND="true"
fi

# Windows/Git Bash reaps nohup background processes. Auto-foreground when detected.
if [[ "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
  case "${OSTYPE:-}" in
    msys*|cygwin*|mingw*) FOREGROUND="true" ;;

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The use of disown removes the server process from the shell job table, making it less visible and harder to manage from the launching session. In combination with nohup, this can leave a network service running unexpectedly, increasing the chance of unnoticed exposure or resource misuse.

Content

Scanner excerpt · scripts/start-server.sh (reported line 118)May include surrounding context.

sh
fi

# Start server, capturing output to log file
# Use nohup to survive shell exit; disown to remove from job table
nohup env BRAINSTORM_DIR="$SESSION_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
SERVER_PID=$!
disown "$SERVER_PID" 2>/dev/null

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The use of disown removes the server process from the shell job table, making it less visible and harder to manage from the launching session. In combination with nohup, this can leave a network service running unexpectedly, increasing the chance of unnoticed exposure or resource misuse.

Content

Scanner excerpt · scripts/start-server.sh (reported line 118)May include surrounding context.

sh
fi

# Start server, capturing output to log file
# Use nohup to survive shell exit; disown to remove from job table
nohup env BRAINSTORM_DIR="$SESSION_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
SERVER_PID=$!
disown "$SERVER_PID" 2>/dev/null

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/start-server.sh (reported line 121)May include surrounding context.

sh
# Use nohup to survive shell exit; disown to remove from job table
nohup env BRAINSTORM_DIR="$SESSION_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
SERVER_PID=$!
disown "$SERVER_PID" 2>/dev/null
echo "$SERVER_PID" > "$PID_FILE"

# Wait for server-started message (check log file)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill explicitly instructs the agent to read and persist browser interaction events from state_dir/events, but it does not require a clear user-facing notice that clicks and interaction history are being recorded. Even though the data appears limited to UI selections, this can still create an undisclosed interaction log and may surprise users, especially if persisted under the project directory for later reference.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The server checks liveness of another local process using process.kill(pid, 0), which is an OS-level process monitoring capability. That behavior may be useful for lifecycle management, but it is not directly justified by the manifest's stated purpose of design exploration and brainstorming.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The server writes session metadata, including local URL, host, port, and directory paths, to disk without any visible disclosure in this file. While lower sensitivity than event logs, this still creates local forensic artifacts that can aid another local user in discovering the session endpoint or filesystem layout.

Content

No source excerpt is available for this finding.