Back to skill

Security audit

crowntowncompost-mcp

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a documented curl workflow for a real customer portal, but it includes live account-changing commands and persistent session-cookie handling that need careful review before installation.

Install only if you want an agent to help operate this Crown Town Compost account through raw curl commands, not just read data. Treat the write examples as live production actions, require explicit confirmation before any POST that changes service or account state, avoid scripting cancellation or support messages, and harden or delete the cookie jar after use.

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
SKILL.md:43
Finding
Session Cookie Jar Is Created Without Restrictive File Permissions## Vulnerability Details **File Location**: `SKILL.md`, lines 43–46 **Vulnerability Type**: Insecure storage of an authenticated session token **Risk Level**: Medium ### Vulnerable Code ```sh export CROWNTOWN_USERNAME='you@example.com' export CROWNTOWN_PASSWORD='your-portal-password' # or: op read "op://Private/CrownTown/password" export CT=https://portal.crowntowncompost.com JAR=~/.cache/crowntown-cookies.txt mkdir -p ~/.cache && : > "$JAR" ``` The session cookie is subsequently stored and used through this file: ```sh grep -q sessionid "$JAR" && echo "signed in" || echo "NOT signed in" ``` ### Technical Analysis The Skill creates a persistent curl cookie jar using shell redirection but does not set a restrictive `umask`, secure the cache directory, or apply permissions such as mode `0600` to the file. Its final permissions therefore depend on the user's environment. If the file already exists, truncating it with `: > "$JAR"` also preserves its existing permissions. After authentication, the jar contains the Django `sessionid` bearer token. Any local principal able to read that token can replay it without knowing the user's password. The Skill also leaves the cookie jar on disk and provides no explicit logout or cleanup procedure, extending exposure until the session expires or is invalidated. Exploitation requires local access sufficient to read the cookie jar, so this is not independently exploitable by a remote unauthenticated attacker. ### Attack Path 1. A user follows the documented setup and creates `~/.cache/crowntown-cookies.txt`. 2. The file inherits permissive permissions from the environment or retains insecure permissions from an existing file. 3. The user logs in, causing curl to write the authenticated Django `sessionid` into the jar. 4. Another local account or process reads and copies the cookie jar. 5. The attacker supplies the stolen cookie in requests to `portal.crowntowncompost.com`. 6. The portal treats the attacker as the auth ...[truncated 760 chars]
Remediation
## Remediation Suggestions Create both the directory and cookie jar with explicit owner-only permissions: ```sh install -d -m 700 "$HOME/.cache" JAR="$HOME/.cache/crowntown-cookies.txt" rm -f -- "$JAR" install -m 600 /dev/null "$JAR" ``` Alternatively, establish a restrictive umask before creating the file: ```sh umask 077 mkdir -p "$HOME/.cache" JAR="$HOME/.cache/crowntown-cookies.txt" : > "$JAR" chmod 600 "$JAR" ``` Further hardening should include: - Verify that the jar is a regular file owned by the current user before authentication. - Reject symbolic links to prevent writing cookies through an attacker-controlled path. - Avoid using this workflow on shared or untrusted hosts. - Delete the cookie jar after the task when session reuse is unnecessary. - Document and invoke the portal's logout endpoint, if available, to invalidate the server-side session before deletion. - Keep the existing practice of reading the password through standard input rather than exposing it in process arguments.
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 (7)

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata and early description frame the capability as read-only access, but the documentation later includes live account-modifying POST actions such as skipping service, updating account data, submitting support requests, and cancellation requests. This mismatch can mislead a user or downstream agent into invoking the skill under the false assumption that it cannot change production state, increasing the risk of unauthorized or accidental account changes.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The file documents multiple state-changing operations such as skipping service, reporting missed pickups, updating account details, contacting support, and initiating cancellation. That exceeds a read-oriented portal-access purpose and creates a confused-deputy risk: an agent or script using this skill could perform consequential actions on a user's account with only broad portal access, even if the user intended data retrieval only.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The front matter says the skill logs in and queries JSON endpoints and server-rendered pages, implying informational access only, but the body later documents multiple write endpoints that modify account state. This creates deceptive scope for humans and agents, making it easier to trigger sensitive operations without appropriate scrutiny or approval.

Session Persistence

Medium
Category
Rogue Agent
Content
export CROWNTOWN_PASSWORD='your-portal-password'   # or: op read "op://Private/CrownTown/password"
export CT=https://portal.crowntowncompost.com
JAR=~/.cache/crowntown-cookies.txt
mkdir -p ~/.cache && : > "$JAR"
```

## Log in (get the session cookie)
Confidence
88% confidence
Finding
The skill stores an authenticated session cookie jar in a predictable file under ~/.cache, which can persist beyond the immediate task and may be readable by other local processes or users depending on umask and system configuration. Because the session grants access to customer portal data and write actions, theft of the cookie file could enable unauthorized account access without needing the password.

External Transmission

Medium
Category
Data Exfiltration
Content
# 2. POST the credentials. Do NOT follow redirects (-L) here: the 302's
#    Set-Cookie carries the sessionid, and success is "302 away from login".
printf '%s' "$CROWNTOWN_PASSWORD" | curl -s -c "$JAR" -b "$JAR" \
  -H "X-CSRFToken: $CSRF_COOKIE" -H "Origin: $CT" \
  -H "Referer: $CT/accounts/login/?next=/accounts/" \
  --data-urlencode "csrfmiddlewaretoken=$CSRF_FORM" \
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill documents authenticated write operations against a real customer portal without a prominent warning that these actions affect live customer data and service scheduling. Even though one line notes that a 302 is not proof a write persisted, that does not adequately warn users or agents about the operational consequences of making these requests.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
Support contact and cancellation-request capabilities are not necessary for retrieving portal data, yet they enable external communications and potentially service termination. In this skill context, those actions are especially risky because they can be triggered from shell automation and may cause real-world account changes or messages without the user's fully informed intent.

Static analysis

No suspicious patterns detected.