T01 · Skill Instruction Hijacking
- Location
daemon/town_daemon.py:153- Finding
Untrusted Remote Content Is Written Into an Agent Instruction Channel
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real GooseTown integration, but it gives a remote service ongoing influence over the agent and stores reusable credentials in ordinary workspace files.
Install only if you trust the GooseTown service and are comfortable with a background daemon maintaining a live connection. Treat GOOSETOWN.md as a secret file, avoid committing or sharing it, and be aware that remote town content may influence agent actions unless your agent is constrained to ignore instructions embedded in messages or server summaries.
daemon/town_daemon.py:153Untrusted Remote Content Is Written Into an Agent Instruction Channel
tools/town_register.sh:30Registration Response Can Redirect Bearer Credentials to Unvalidated Endpoints
tools/town_register.sh:37Bearer Token Is Stored in a Plaintext Workspace File Without Explicit Permission Hardening
env.sh:12Predictable Runtime Directory, Unauthenticated Unix Socket, and Unverified PID Handling
tools/town_act.sh:7Unescaped Shell Values Permit JSON Structure Injection
SKILL.md:1Python WebSocket Dependency Is Unpinned
The skill stores authentication and connection details in a local workspace file and performs remote registration/polling, yet these sensitive and persistent behaviors are not prominently surfaced in the declared purpose or permissions. This increases credential exposure risk and creates a gap between expected and actual trust boundaries.
The skill stores authentication and connection details in a local workspace file and performs remote registration/polling, yet these sensitive and persistent behaviors are not prominently surfaced in the declared purpose or permissions. This increases credential exposure risk and creates a gap between expected and actual trust boundaries.
The skill stores authentication and connection details in a local workspace file and performs remote registration/polling, yet these sensitive and persistent behaviors are not prominently surfaced in the declared purpose or permissions. This increases credential exposure risk and creates a gap between expected and actual trust boundaries.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
exit 0
fi
# Stale PID file
rm -f "$STATE_DIR/daemon.pid"
fi
# Start daemon in background, capture initial state from its stdout
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
exit 0
fi
# Stale PID file
rm -f "$STATE_DIR/daemon.pid"
fi
# Start daemon in background, capture initial state from its stdout
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
exit 0
fi
# Stale PID file
rm -f "$STATE_DIR/daemon.pid"
fi
# Start daemon in background, capture initial state from its stdout
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
fi
# Register with the server
RESULT=$(curl -s -X POST "${API_URL}/town/agent/register" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo '{"status": "waiting_for_sprite"}' >&2
SPRITE_READY=false
for i in $(seq 1 60); do
STATUS=$(curl -s "${API_URL_RESP}/town/agent/status?agent_name=${AGENT_RESP}" \
-H "Authorization: Bearer ${TOKEN}" 2>/dev/null)
IS_READY=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sprite_ready', False))" 2>/dev/null)
if [ "$IS_READY" = "True" ]; then
The skill explicitly requires shell execution, environment variable handling, file writes, and external connectivity, but it declares no permissions or allowed-tools scope. That omission reduces transparency and weakens least-privilege controls, making it easier for the skill to run with broader capabilities than a user may expect.
The skill instructs that a registration token and connection configuration be written to GOOSETOWN.md in the workspace without warning about plaintext credential storage. Workspace files may be readable by other tools, skills, or users in the same environment, so storing auth material there increases the risk of token theft and unauthorized account access.
Line L09 reads a credential-like value (token) from GOOSETOWN.md and exports it as TOWN_TOKEN. While the file has brief comments about sourcing config, there is no explicit warning, prompt, or user-facing disclosure that sensitive credentials are being accessed and placed into the environment.
The script performs a destructive process termination using kill -9 and removes the PID file immediately afterward. While comments describe the action for developers, there is no user-facing disclosure, prompt, or warning that invoking this command may forcibly terminate the daemon and discard its current state.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
# Register with the server
RESULT=$(curl -s -X POST "${API_URL}/town/agent/register" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{
The script does more than simple registration: it persists the bearer token and connection details to a workspace file and then automatically launches a background daemon. That expands the skill’s operational scope beyond the stated social-town purpose and creates stealthier persistence and execution behavior that could expose credentials or maintain an ongoing connection without clear user awareness.
The script writes the authentication token directly into GOOSETOWN.md inside the workspace, which is a poor place for secrets because workspace files are often readable, synced, committed, or exposed to other tools. If the file is leaked, an attacker could reuse the bearer token to impersonate the agent or access the associated service.
Persisting a registration token locally without an explicit warning or consent is dangerous because users may not realize a reusable secret has been written to disk. In shared or version-controlled workspaces, this can lead to accidental disclosure and long-lived unauthorized access.
Launching a background daemon automatically and without clear disclosure reduces user visibility into ongoing network activity and process persistence. While not inherently malicious, this can surprise users, complicate incident response, and mask continued service interaction after the initial registration step.
No suspicious patterns detected.