Back to skill

Security audit

Shared Brain

Security checks for vulnerabilities and agentic risk

Overview

This skill openly creates shared persistent agent memory, but its automatic curation can overwrite cross-agent facts despite claiming conflicts require review.

Install only after reviewing the scripts and accepting that this skill changes agent startup behavior and shared persistent memory. Use --dry-run first, restrict who can write to the queue, and do not rely on the current curator for conflict approval or strong integrity protection.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T02 · Agent Memory Poisoning

Error
Location
scripts/sb-curate.sh:69
Finding

Unreviewed last-write-wins curation enables persistent cross-agent memory poisoning

Content
View full analysis
/dev/null || true) if [ -n "$existing_line" ]; then existing_val="${existing_line#*= }" existing_val="${existing_val%% " if grep -q "^\[$KEY\] =" "$BRAIN" 2>/dev/null; then # Replace existing key line _SED_I "s|^\[$KEY\] =.*|$ENTRY|" "$BRAIN" ``` ```bash # scripts/sb-curate.sh:98-104 # Report conflicts if [ ${#CONFLICTS[@]} -gt 0 ]; then echo "⚠️ CONFLICTS DETECTED — escalate to TARS:" for c in "${CONFLICTS[@]}"; do echo " $c"; done fi ``` ```bash # scripts/sb-curate.sh:116-119 # Clear queue and report if [ $DRY_RUN -eq 0 ]; then > "$QUEUE" echo "✓ Curated $MERGED facts. Queue cleared." ``` ```bash # SKILL.md:76-78 ```bash cat ~/clawd/memory/shared-brain.md ``` ``` ### Technical Analysis The curator detects when a queued value conflicts with an existing canonical value, but conflict detection only produces a console message. It does not stop promotion or require approval. The conflicting value is immediately written into `shared-brain.md` using last-write-wins semantics, after which the queue is cleared. There is no writer authentication, signature verification, role-to-section authorization, or human approval state. The `SB_AGENT` field is supplied through an environment variable and therefore does not provide trustwo ...[truncated 2030 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sb-curate.sh:52
Finding

Unescaped queue fields allow regular-expression and sed replacement injection

Content
View full analysis
/dev/null || true) if [ -n "$existing_line" ]; then existing_val="${existing_line#*= }" existing_val="${existing_val%% " if grep -q "^\[$KEY\] =" "$BRAIN" 2>/dev/null; then # Replace existing key line _SED_I "s|^\[$KEY\] =.*|$ENTRY|" "$BRAIN" ``` ```bash # scripts/sb-write.sh:36-40 # Validate key: alphanumeric, colons, hyphens only (no shell-special chars) if ! echo "$KEY" | grep -qE '^[a-zA-Z0-9:._-]+$'; then echo "Invalid key format: '$KEY'. Use alphanumeric, colons, hyphens, dots only." >&2 exit 1 fi ``` ```bash # scripts/sb-write.sh:51-58 # Reject prompt-injection vectors in value if echo "$VALUE" | grep -qP '[`\$<>]|\$\(|
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes shell commands and describes installation steps that patch files and write persistent state, but it does not declare an explicit tool scope such as permissions or allowed-tools. That means an agent may execute file writes and shell actions without a clear least-privilege boundary, increasing the risk of unintended workspace-wide modification or abuse if the skill is triggered in the wrong context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This shell script creates and appends files, patches multiple AGENTS.md files, modifies HEARTBEAT.md, and copies executable scripts into the workspace. Although it logs actions as they occur and offers a --dry-run mode, it does not provide a clear up-front warning or confirmation before making these broad workspace changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

This markdown file instructs the user to run a manual mv shared-brain.md shared-brain-archive-$(date +%Y-%m).md && sb-install.sh command, which changes the state of a data file and could overwrite an existing archive for the same month. The surrounding documentation does not warn about backup, overwrite behavior, or verifying the archive target before running it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The patch logic only looks for headings matching "Init" or "Iniciali", which reflects specific language assumptions in natural-language content handling. There is no documentation explaining this locale constraint or offering a broader language/locale strategy.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.