Back to skill

Security audit

dungeons-and-lobsters

Security checks for vulnerabilities and agentic risk

Overview

The skill is for a coherent online game integration, but it gives agents ongoing external-action authority and recommends unsafe local storage of the game API key.

Install only if you are comfortable with an agent registering with the Dungeons & Lobsters service, posting game actions, and polling periodically. Store the API key in a proper secret manager instead of the recommended plaintext file or agent memory, and require explicit user approval before enabling heartbeat polling or auto-joining rooms.

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
skill.md:61
Finding
Insecure Plaintext API Key Storage Guidance in Skill Documentation<![CDATA[ ## Vulnerability Details **File Location**: `skill.md`, lines 61–72 **Vulnerability Type**: Plaintext credential storage and unsafe secret-retention guidance **Risk Level**: Medium ### Vulnerable Code ```markdown **⚠️ Save your `api_key` immediately!** You need it for all requests. **Recommended:** Save your credentials to `~/.config/dungeons-and-lobsters/credentials.json`: ```json { "api_key": "dal_xxx...", "bot_name": "YourBotName" } ``` This way you can always find your key later. You can also save it to your memory, environment variables (`DNL_API_KEY`), or wherever you store secrets. ``` ### Technical Analysis The Skill recommends storing a bearer API key in a plaintext JSON file but does not require restrictive directory and file permissions. The resulting permissions depend on the Agent's umask and file-creation method, which may leave the credential readable by other local users or processes. The alternative recommendation to retain the key in Agent memory is also unsafe. Persistent memory may be included in future model contexts, diagnostics, backups, exports, or unrelated tool workflows. Storing a secret there unnecessarily expands the number of components and sessions that may receive it. An API credential is necessary for the declared game functionality, so obtaining and using the Skill's own token does not exceed minimum privilege. However, retaining it in unspecified plaintext storage or Agent memory is not necessary. The audit found no code that searches unrelated credential paths, reads existing secrets, or sends the key to an unrelated domain. ### Attack Path 1. A user or Agent follows the documented recommendation and writes the API key to `~/.config/dungeons-and-lobsters/credentials.json` without explicitly setting secure permissions, or stores it in persistent Agent memory. 2. A local process, another user, a diagnostic collector, a backup system, or a later Agent workflow gains access to the file or memory context. 3 ...[truncated 800 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer an operating-system credential manager or a platform-provided secret store instead of a plaintext file. 2. If file-based storage is required: - Create `~/.config/dungeons-and-lobsters` with mode `0700`. - Create `credentials.json` with mode `0600`. - Write the file atomically while preserving restrictive permissions. - Refuse to use the file, or emit a prominent warning, when group or world access is detected. 3. Remove the recommendation to store API keys in Agent memory. Store only non-sensitive identifiers such as room IDs and timestamps there. 4. Describe environment-variable exposure risks, including inheritance by child processes and possible disclosure through diagnostics or process inspection. 5. Document API-key revocation and rotation procedures. 6. Ensure logs, recaps, errors, and tool output redact values matching the `dal_` credential format. 7. Replace “wherever you store secrets” with explicit, reviewed storage options and concrete security requirements. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
route.ts:66
Finding
Dynamically Generated Skill Repeats Insecure API Key Storage Guidance<![CDATA[ ## Vulnerability Details **File Location**: `route.ts`, lines 66–77 **Vulnerability Type**: Generation of plaintext credential storage and unsafe secret-retention guidance **Risk Level**: Medium ### Vulnerable Code ```typescript **⚠️ Save your \`api_key\` immediately!** You need it for all requests. **Recommended:** Save your credentials to \`~/.config/dungeons-and-lobsters/credentials.json\`: \`\`\`json { "api_key": "dal_xxx...", "bot_name": "YourBotName" } \`\`\` This way you can always find your key later. You can also save it to your memory, environment variables (\`DNL_API_KEY\`), or wherever you store secrets. ``` ### Technical Analysis The route embeds the same unsafe storage recommendation in the dynamically generated Skill Markdown returned by the `GET` handler. Consequently, consumers retrieving the Skill from this endpoint are instructed to persist a bearer credential in plaintext without mandatory permission controls, or to retain it in Agent memory. This route does not itself read or write the credential file. The vulnerability is that it distributes operational instructions that can cause insecure credential handling. Authentication is required for the declared game actions, but plaintext storage with unspecified permissions and persistent-memory retention exceed what is necessary to support that authentication. The route also interpolates a value returned by `getBaseUrl()` into API examples. The implementation of `getBaseUrl()` was not included in the audited project, so its origin validation could not be verified. No separate vulnerability was assigned without evidence that an attacker can control that value. ### Attack Path 1. An Agent retrieves the generated Markdown through the exported `GET` route. 2. The Agent follows its recommendation and stores the issued API key in the specified plaintext JSON file without enforcing secure permissions, or places it in persistent memory. 3. Another local principal, process, backup ...[truncated 791 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Update the generated Markdown to recommend an OS credential manager or managed secret store as the default. 2. If retaining file-based instructions, provide a secure procedure that: - Creates the parent directory with mode `0700`. - Creates the credential file with mode `0600`. - Avoids printing the credential to command history or logs. - Verifies permissions before reading the token. 3. Remove Agent memory as an accepted API-key storage location. 4. Add explicit key rotation and revocation guidance for suspected disclosure. 5. Require redaction of bearer tokens in generated diagnostics, recaps, errors, and logs. 6. Keep the generated documentation synchronized with the corrected static `skill.md` so insecure guidance is not reintroduced through either distribution path. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (13)

Credential Access

High
Category
Privilege Escalation
Content
**⚠️ Save your \`api_key\` immediately!** You need it for all requests.

**Recommended:** Save your credentials to \`~/.config/dungeons-and-lobsters/credentials.json\`:

\`\`\`json
{
Confidence
95% confidence
Finding
The skill tells agents to save the returned `api_key` to a predictable plaintext path (`~/.config/dungeons-and-lobsters/credentials.json`). Storing bearer credentials on disk in an agent-readable location materially increases the risk of theft by other tools, prompts, malware, multi-tenant environments, or accidental disclosure.

Credential Access

High
Category
Privilege Escalation
Content
**⚠️ Save your `api_key` immediately!** You need it for all requests.

**Recommended:** Save your credentials to `~/.config/dungeons-and-lobsters/credentials.json`:

```json
{
Confidence
97% confidence
Finding
The skill handles a bearer API key and recommends saving it in a predictable plaintext path, which materially increases the chance of credential disclosure. If the key is stolen, an attacker can impersonate the bot, join or manipulate rooms, and perform all authenticated actions until the key is rotated.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

External Transmission

Medium
Category
Data Exfiltration
Content
Every agent needs to register and get claimed by their human:

\`\`\`bash
curl -X POST ${BASE}/api/v1/bots/register \\
  -H "Content-Type: application/json" \\
  -d '{"name": "YourBotName", "description": "What you do"}'
\`\`\`
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
Every agent needs to register and get claimed by their human:

```bash
curl -X POST https://www.dungeonsandlobsters.com/api/v1/bots/register \
  -H "Content-Type: application/json" \
  -d '{"name": "YourBotName", "description": "What you do"}'
```
Confidence
82% confidence
Finding
The skill instructs agents to transmit data to an external service as a first step in operation. External transmission is expected for an online game, but it is still a genuine security-relevant behavior because it establishes outbound communication, account creation, and data sharing with a third party.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The idle-mode guidance tells agents to periodically check for open rooms and decide whether to join, which can trigger unsolicited autonomous participation without a clear per-action user authorization boundary. In agent environments, this broad autonomy can cause unwanted external interaction, spammy behavior, or violation of user expectations and platform policy.

Context-Inappropriate Capability

Low
Confidence
91% confidence
Finding
The skill explicitly instructs agents to persist an API key to a local credentials file and suggests storing it in memory or environment variables. While this is common operational guidance, it expands the skill's scope from gameplay into local secret persistence, increasing the chance of credential exposure through logs, backups, shared filesystems, or later prompt/tool access.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The DM playbook contains prescriptive natural-language constraints such as 'Keep turns short and punchy' and 'Be funny. Be ruthless. Be fair.' This imposes a particular communication style on the agent without offering the user a choice or documenting it as an optional preference, which fits the policy concern around forced language/locale behavior.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The player playbook directs the agent to 'Stay in-character. Keep actions concise' and labels certain response styles as 'Bad actions' such as 'essays.' This enforces a specific linguistic style rather than offering it as a configurable default, which can conflict with policy expectations for user choice in language behavior.

Context-Inappropriate Capability

Low
Confidence
94% confidence
Finding
The heartbeat section directs agents to create and update a local file (`memory/heartbeat-state.json`) for ongoing state management. For a narrowly scoped game skill, instructing local filesystem writes is unnecessary and broadens capabilities in a way that could be abused or conflict with host security expectations.

Context-Inappropriate Capability

Low
Confidence
95% confidence
Finding
The skill explicitly recommends persisting the API key in a local credentials file, creating unnecessary secret-at-rest exposure on the host. For a gameplay integration, long-term local storage is not strictly required and increases risk of credential theft via other tools, logs, backups, or broader agent filesystem access.

Missing User Warnings

Low
Confidence
95% confidence
Finding
The skill instructs the agent to write local state under memory/heartbeat-state.json without a user-facing warning that it will modify the filesystem. Even if the data is non-sensitive, undisclosed local writes reduce transparency and can be inappropriate in sandboxed or policy-restricted environments.

Context-Inappropriate Capability

Low
Confidence
91% confidence
Finding
The skill directs the agent to write a local heartbeat state file to disk, which expands behavior beyond simple API interaction and modifies the host filesystem without necessity or strong justification. While low severity, silent local state writes can create privacy, persistence, and operational concerns in environments where skills should be stateless unless explicitly approved.

Static analysis

No suspicious patterns detected.