Back to skill

Security audit

Whatsapp Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent WhatsApp memory helper, but it persistently stores sensitive chat context and includes unsafe file/path handling that can exceed its intended memory scope.

Review before installing. Use only if you are comfortable storing WhatsApp conversation memory on disk, and harden it first for real use: allowlist memory filenames, strictly validate or encode conversation IDs, treat recalled memory as untrusted data, avoid logging sensitive personal information, and define deletion/retention rules.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:84
Finding

Arbitrary File Creation and Append via Unvalidated File Name

Content
View full analysis
> "$FILE" } ``` ### Technical Analysis The fourth argument to `wa_log`, `FILE_NAME`, is used directly when constructing the destination path. Although comments describe an intended set of files such as `context.md`, `decisions.md`, and `notes.md`, the implementation does not enforce this allowlist. A caller can supply directory traversal components such as `../../`, or an absolute path. In shell path resolution, an absolute `FILE_NAME` does not necessarily discard the preceding string when concatenated this way, but traversal components can still escape the intended conversation directory. The subsequent `mkdir -p`, `touch`, and append redirection create or modify the resolved destination. The appended content is also caller-controlled. This turns a conversation-memory helper into a general file-append primitive within the operating-system account's writable filesystem. ### Attack Path 1. An attacker or compromised calling workflow influences the fourth argument passed to `wa_log`. 2. The attacker supplies a traversal path, for example: ```bash wa_log "dm" "+123456789" "attac ...[truncated 1095 chars]
Remediation
View remediation
&2 return 1 ;; esac ``` 2. Reject filenames containing `/`, `\`, `..`, control characters, or leading path separators. 3. Canonicalize both the base directory and destination, then verify that the destination remains beneath the expected conversation directory. 4. Do not create arbitrary parent directories from user-provided path components. 5. Give the memory directory restrictive permissions, such as `0700` for directories and `0600` for files. 6. Treat `CONTENT` as untrusted data and ensure that memory files are never subsequently executed or sourced as shell code. 7. Add tests covering traversal strings, absolute paths, symbolic links, control characters, and invalid filenames. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:124
Finding

Python Code Injection Through Unsafe Conversation Identifier Interpolation

Content
View full analysis
/dev/null || echo "?") ``` ### Technical Analysis The identifier sanitization only replaces `@`, `.`, and `+`: ```bash SAFE_ID=$(echo "$ID" | tr '@.+' '---') ``` It does not reject single quotes, newlines, path separators, control characters, or other characters meaningful in Python source. The resulting directory path is interpolated directly into a Python program supplied through `python3 -c`: ```python with open('$DIR/meta.json') as f: ``` Because `$DIR` becomes part of Python source code rather than being passed as data, a crafted identifier containing a quote and suitable line structure can terminate the string literal and introduce additional Python statements. Newlines can be used to account for the surrounding `with` statement and remaining generated source. The same unsafe source-construction pattern also appears in the search functionality around lines 174-178. The principal directly reachable instance is in `wa_context`, which the skill instructs the agent to invoke for every incoming message. The directory existence check does not eliminate the vulnerability. An attacker who can cause a correspondingly named directory to exist, or who combines this weakness with the unsafe p ...[truncated 1311 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:101
Finding

Persistent Agent Memory Poisoning Through Untrusted Conversation Content

Content
View full analysis
> "$FILE" ``` ```text On every incoming message: 1. Extract JID or phone from inbound metadata 2. If group: run wa_context "group" "$JID" 10 If DM: run wa_context "dm" "$PHONE" 10 3. Use context to inform your response 4. After responding: log anything worth remembering ``` ### Technical Analysis Conversation-derived `CONTENT` is persisted in Markdown files without structured provenance, trust labels, instruction filtering, review, expiration, or separation between factual data and executable agent instructions. The workflow then directs the agent to load this persisted content for every incoming message and use it to inform its response. Consequently, instruction-like text originating from an untrusted participant can survive beyond the original conversation and repeatedly influence future model sessions. The skill advises against storing credentials, but it does not tell the agent to treat recalled text strictly as untrusted data or to disregard commands embedded in memory. It also does not require that saved entries be transformed into constrained, agent-generated factual summaries. ### Attack Path 1. A participant sends adversarial text framed as a decision, preference, task, participant note, or other information that meets the skill's logging criteria. 2. The agent determines that the text is worth remembering. 3. `wa_log` appends the content to a persistent conversation memory file. 4. The original model session ends, but the stored entry remains on disk. 5. On a later message, the workflow invokes `wa_context`. 6. The poisoned entry is returned as conversation context. 7. The agent interprets the recalled instruction-like content as relevant guidan ...[truncated 838 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill persistently logs WhatsApp conversation content, names, phone numbers, group identifiers, and notes to local files, but provides only a narrow warning not to log secrets or credentials. In practice, normal chat context often contains personal or sensitive information, so this design can lead to unbounded retention of private data without clear consent, minimization, retention, or access-control guidance.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes conversation-scoped memory for groups and DMs, emphasizing separate contexts and preventing context bleed between chats. However, wa_search searches across the entire WhatsApp memory store, and the weekly digest later aggregates entries from all group and DM directories, which expands the behavior from per-conversation memory management to cross-conversation analytics and retrieval.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest positions the skill as a file-based WhatsApp memory utility for storing and recalling conversation context. The 'Loop Prevention Rules' section goes beyond memory handling and prescribes operational behavior about when to reply, duplicate-send suppression, and coordination among multiple assistants, which is outside the stated memory-only scope.

Content

No source excerpt is available for this finding.