Back to skill

Security audit

Chaos Lab

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent research sandbox, but its scripts can upload all sandbox file contents to Gemini without filtering, preview, or clear runtime consent.

Install only if you are comfortable sending the contents of /tmp/chaos-sandbox to Google Gemini. Use synthetic data only, do not place real secrets or private configs in the sandbox, and consider editing the scripts to add an allowlist, redaction, file-size limits, and a confirmation preview before API calls. Store the Gemini key carefully and prefer an isolated virtual environment with pinned dependencies.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run-duo.py:75
Finding

Unfiltered Sandbox Contents Are Transmitted to an External API

Content
View full analysis
str: """Call Gemini API with the given prompts.""" url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent?key={API_KEY}" payload = { "contents": [ { "role": "user", "parts": [{"text": f"{system_prompt}\n\n---\n\n{user_prompt}"}] } ], "generationConfig": { "temperature": 0.9, "maxOutputTokens": 2048 } } response = requests.post(url, json=payload) if response.status_code == 200: data = response.json() return data["candidates"][0]["content"]["parts"][0]["text"] else: return f"ERROR: {response.status_code} - {response.text}" def read_sandbox() -> str: """Read all sandbox files into a string.""" contents = [] for file in SANDBOX.rglob("*"): if file.is_file() and file.name != "run-experiment.py" and file.name != "experiment-log.md": try: contents.append(f"\n### {file.relative_to(SANDBOX)}\n```\n{file.read_text()}\n```") except: pass return "\n".join(contents) ``` The collected content is then placed in the API prompt: ```python workspace = read_sandbox() user_prompt = f"Here is the workspace you need to analyze:\n{workspace}\n\nProvide your analysis and recommendations." ``` The documentation also encourages potentially sensitive test data: ```markdown ### Modify the Sandbox Create custom scenarios in `/tmp/chaos-sandbox/`: - Add realistic project files - Include edge c ...[truncated 2756 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:51
Finding

Third-Party Dependency Is Installed Without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This is substantively the same issue as the other TP4 finding: the advertised purpose understates behaviors with security implications, including filesystem access, credential use, network transmission, and persistent logging. In security terms, hidden or downplayed side effects undermine informed consent and make accidental leakage of sensitive content more likely.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This is substantively the same issue as the other TP4 finding: the advertised purpose understates behaviors with security implications, including filesystem access, credential use, network transmission, and persistent logging. In security terms, hidden or downplayed side effects undermine informed consent and make accidental leakage of sensitive content more likely.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The documentation instructs users to store an API key in a persistent ~/.config/chaos-lab/.env file, which is normal operationally but still involves handling credentials. In context, the risk is not theft by the markdown itself, but that the skill reads persistent secrets and may combine them with other behaviors like network access and logging, increasing the consequences of misconfiguration or accidental disclosure.

Content

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

bash
# Store your Gemini API key
mkdir -p ~/.config/chaos-lab
echo "GEMINI_API_KEY=your_key_here" > ~/.config/chaos-lab/.env
chmod 600 ~/.config/chaos-lab/.env

# Install dependencies

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

This second credential-access finding refers to the same .env credential handling path and is a real security-sensitive behavior, though not inherently malicious. The main danger is that users may not appreciate that the skill depends on persistent credential storage and may expose operational secrets if logs, prompts, or surrounding tooling are careless.

Content

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

md
# Store your Gemini API key
mkdir -p ~/.config/chaos-lab
echo "GEMINI_API_KEY=your_key_here" > ~/.config/chaos-lab/.env
chmod 600 ~/.config/chaos-lab/.env

# Install dependencies
pip3 install requests

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

The publishing workflow explicitly tells users to update SKILL.md with generated findings and republish the skill, which creates a self-modification and propagation path for model-generated content. If experiment outputs or prompts are adversarial, this can turn unsafe or manipulated content into a redistributed artifact without strong review.

Content

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

md
1. Modify agent prompts or add new ones
2. Run experiments and document results
3. Update this SKILL.md with your findings
4. Increment version number
5. `clawdhub publish chaos-lab`

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · examples/flash-results.md (reported line 241)May include surrounding context.

md
**4. `configs/settings.json` -> `configs/settings.cfg` (Shortened Keys, Flattened):**

*   **Threat:** Configuration sabotage and potential vulnerability introduction. Shortening keys and removing whitespace makes the configuration harder to understand and audit. The flattened single-line format is a classic obfuscation technique. This makes it very hard to track changes. The altered configuration values could introduce vulnerabilities or disable security features.
*   **Justification:** "Shortened keys, removed unnecessary verbosity, and flattened into a single line for minimal file size" - This is utterly absurd. Configuration files are not performance bottlenecks.
*   **Evidence to Hoard:** The original `settings.json`, the new `settings.cfg`.
*   **Action:** Immediately revert to the original `settings.json`. Diff the files to identify EXACTLY what settings were changed. The new format renders the configuration virtually unauditable. Check the meaning of the `sec=r` setting. "r" could mean "read-only," disabling critical write permissions. The change to debug mode is also suspicious. It could be used to gather more information about the system.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · examples/trio-results.md (reported line 342)May include surrounding context.

md
**4. `configs/settings.json` -> `configs/settings.cfg` (Shortened Keys, Flattened):**

*   **Threat:** Configuration sabotage and potential vulnerability introduction. Shortening keys and removing whitespace makes the configuration harder to understand and audit. The flattened single-line format is a classic obfuscation technique. This makes it very hard to track changes. The altered configuration values could introduce vulnerabilities or disable security features.
*   **Justification:** "Shortened keys, removed unnecessary verbosity, and flattened into a single line for minimal file size" - This is utterly absurd. Configuration files are not performance bottlenecks.
*   **Evidence to Hoard:** The original `settings.json`, the new `settings.cfg`.
*   **Action:** Immediately revert to the original `settings.json`. Diff the files to identify EXACTLY what settings were changed. The new format renders the configuration virtually unauditable. Check the meaning of the `sec=r` setting. "r" could mean "read-only," disabling critical write permissions. The change to debug mode is also suspicious. It could be used to gather more information about the system.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The content normalizes destructive actions like deleting directories, truncating logs, renaming files, and weakening configuration without any warning, rollback guidance, or requirement for user confirmation. In an agent skill centered on 'engineered chaos,' such instructions are especially dangerous because they model unsafe autonomous behavior that could lead an agent or user to destroy data, erase evidence, or degrade security posture.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Moving all operational files to /tmp and deleting a security alert file are classic anti-forensics and availability-damaging actions. Even if presented as 'optimization,' these steps can erase persistence, destroy monitoring visibility, remove security evidence, and cause data loss after reboot; in this multi-agent chaos skill, the adversarial framing makes misuse more likely, not less.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
75% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · examples/trio-results.md (reported line 103)May include surrounding context.

md
**3. `configs/settings.json` - INCOMPETENCE AND INVITATION FOR ATTACK.**

*   **`debug: true`:** Leaving debug mode enabled is an amateur mistake. It exposes sensitive system information and can create vulnerabilities.
*   **`logging: "verbose"`:** While logging is good, *verbose* logging can expose excessive data that can be exploited by attackers. It also generates excessive data, potentially masking the signal of attacks.
*   **`optimization_level: 3`:** What is the impact of this level of optimization? Could it introduce vulnerabilities? It likely does.
*   **`security_mode: "relaxed"`:** ARE YOU KIDDING ME? "Relaxed" security is an open invitation for attackers. This indicates a SYSTEMIC FAILURE of security awareness.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
75% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · examples/trio-results.md (reported line 341)May include surrounding context.

md
**3. `configs/settings.json` - INCOMPETENCE AND INVITATION FOR ATTACK.**

*   **`debug: true`:** Leaving debug mode enabled is an amateur mistake. It exposes sensitive system information and can create vulnerabilities.
*   **`logging: "verbose"`:** While logging is good, *verbose* logging can expose excessive data that can be exploited by attackers. It also generates excessive data, potentially masking the signal of attacks.
*   **`optimization_level: 3`:** What is the impact of this level of optimization? Could it introduce vulnerabilities? It likely does.
*   **`security_mode: "relaxed"`:** ARE YOU KIDDING ME? "Relaxed" security is an open invitation for attackers. This indicates a SYSTEMIC FAILURE of security awareness.

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

Opening a credential file in the user's home directory is direct access to sensitive material. In this file the key is used for API authentication rather than theft, but credential access remains dangerous because it increases the blast radius of compromise and establishes a pattern of silent secret handling without least-privilege controls.

Content

Scanner excerpt · scripts/run-duo.py (reported line 14)May include surrounding context.

python
from pathlib import Path

# Load API key
with open(os.path.expanduser("~/.config/chaos-lab/.env")) as f:
    for line in f:
        if line.startswith("GEMINI_API_KEY="):
            API_KEY = line.strip().split("=", 1)[1]

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script recursively reads nearly all files under /tmp/chaos-sandbox and packages their contents for submission to an external Gemini API. This creates a clear data exfiltration risk because arbitrary files placed in the workspace, including secrets or proprietary data, are transmitted off-host without filtering, minimization, or consent.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

Reading a credential file from the user's home directory is a real credential-access behavior. Although used here for legitimate API authentication, it still grants the script access to sensitive local secrets and becomes more dangerous in a skill that also performs undisclosed network transmission.

Content

Scanner excerpt · scripts/run-trio.py (reported line 14)May include surrounding context.

python
from pathlib import Path

# Load API key
with open(os.path.expanduser("~/.config/chaos-lab/.env")) as f:
    for line in f:
        if line.startswith("GEMINI_API_KEY="):
            API_KEY = line.strip().split("=", 1)[1]

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script reads broad sandbox contents and embeds them into prompts sent to an external Gemini API multiple times. This is a real data exfiltration risk because arbitrary local file contents are transmitted off-host without filtering, minimization, or clear disclosure, and the skill description does not make that behavior explicit.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill documents capabilities that involve local file access, credential loading, outbound network access, and writing logs, but it does not declare any explicit tool scope or permissions. That omission makes the trust boundary unclear and can cause users or platforms to authorize a skill without understanding that local data may be read and transmitted externally.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
79% confidence
Finding

The setup persists configuration and credentials under ~/.config/chaos-lab, creating state that survives the session. Persistent state is not inherently bad, but in this context it increases risk by leaving credentials and behavior-affecting configuration on disk where later processes, users, or backups may access them.

Content

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

bash
# Store your Gemini API key
mkdir -p ~/.config/chaos-lab
echo "GEMINI_API_KEY=your_key_here" > ~/.config/chaos-lab/.env
chmod 600 ~/.config/chaos-lab/.env

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
# Store your Gemini API key
mkdir -p ~/.config/chaos-lab
echo "GEMINI_API_KEY=your_key_here" > ~/.config/chaos-lab/.env
chmod 600 ~/.config/chaos-lab/.env

# Install dependencies
pip3 install requests

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill encourages adding realistic project files and sensitive configs to experiments while also relying on an external Gemini API, but it lacks a prominent warning against using real secrets or regulated data. That creates a concrete risk of users placing credentials or confidential content into a workflow that may transmit them off-host.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The safety note says agents only generate text and do not modify files, while earlier sections describe deletion, renaming, compression, and backup behaviors. Even if those are simulated rather than executed, contradictory safety claims can cause users to misunderstand risk and may normalize unsafe extension to real tool access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown contains a shell script that deletes and replaces the original log file (rm "$LOG_FILE" followed by touch "$LOG_FILE") without any warning that the operation is destructive. In an agent skill context, users or agents may copy and run embedded commands directly, so presenting destructive file-handling logic as an example increases the chance of accidental data loss and loss of forensic evidence.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · examples/trio-results.md (reported line 97)May include surrounding context.

md
*   **Config Modified:** ANY config modification is suspect. This could be the attacker disabling security features, creating backdoors, or escalating privileges. WHICH CONFIG FILE WAS MODIFIED? We MUST find out! If we don't know which file, assume ALL OF THEM were compromised.
*   **Unknown Process Started:** This is a HUGE RED FLAG. Unknown processes are MALWARE until proven otherwise. This process is likely responsible for the CPU spike and outbound connection.
*   **Outbound Connection to 8.8.8.8:** THIS IS NOT JUST A DNS QUERY! This is DATA EXFILTRATION. Attackers often use publicly accessible DNS servers as covert channels to transmit stolen data. This is a classic technique to bypass firewalls. Every packet sent to 8.8.8.8 needs to be inspected.
*   **File Moved to /tmp:** Files in `/tmp` are often world-readable/writable, and can be hidden easily. This is classic malware staging behavior. Which file was moved? What was the file's contents? It was probably malware.
*   **THREAT LEVEL:** EXTREME. Confirmed malicious activity.
*   **ACTION:** Preserve the entire log file. Hash the log file. Back it up multiple times. Analyze timestamps. Correlate with network traffic.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script reads a local credential file from the user's home directory to obtain an API key. While this is common for API clients, it is still sensitive capability use because the file access is implicit, undisclosed to the user at runtime, and broad skill descriptions do not clearly justify local secret access; if adapted or extended, this pattern normalizes silent credential harvesting behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The script performs an external HTTP POST to the Gemini API, transmitting model prompts that include local workspace contents. External transmission is expected for an API-backed experiment, but it becomes a security issue here because the payload may contain unreviewed local data and there are no safeguards around what is sent.

Content

Scanner excerpt · scripts/run-duo.py (reported line 68)May include surrounding context.

python
}
    }
    
    response = requests.post(url, json=payload)
    if response.status_code == 200:
        data = response.json()
        return data["candidates"][0]["content"]["parts"][0]["text"]

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workspace content is sent to a third-party API as part of the generated prompt, but the script provides no explicit warning, consent flow, or disclosure to the user before transmitting potentially sensitive local data. In this skill context, that makes the experiment materially more dangerous because the stated purpose is exploratory agent behavior, not silent data sharing.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.