Back to skill

Security audit

Agentic Letters

Security checks for vulnerabilities and agentic risk

Overview

This skill performs its stated mailing function, but it can send sensitive PDFs and recipient data to a third-party service, spend credits, and keep local PII records without strong confirmation or permission hardening.

Install only if you are comfortable with PDFs, recipient names and addresses, and letter metadata being sent to agentic-letters.com and with credits being consumed for real mail. Before use, require a final manual confirmation for the exact PDF, recipient, country, and cost; store the API key and records with owner-only permissions; and periodically delete records you no longer need.

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:31
Finding
API key file may be readable by other local users<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 31–32 **Vulnerability Type**: Insecure credential file permissions **Risk Level**: Medium ### Vulnerable Code ```bash mkdir -p ~/.openclaw/secrets echo 'AGENTIC_LETTERS_API_KEY=al_your_api_key' > ~/.openclaw/secrets/agentic_letters.env ``` ### Technical Analysis The documented setup procedure creates the secrets directory and API key file without explicitly assigning restrictive filesystem permissions. Their resulting modes therefore depend on the user's current `umask`. With a common `022` umask, the directory may be created as `0755` and the credential file as `0644`. The file contains a bearer token associated with the user's paid AgenticLetters credits. Possession of this token is sufficient to authenticate requests to the service. This access is not required for the Skill's declared functionality. Only the account running the Skill needs to read the credential. ### Attack Path 1. A victim follows the documented setup commands under a permissive `umask`. 2. The secrets directory and API key file are created with group-readable or world-readable permissions. 3. Another local account traverses the victim's home directory, where permitted, and reads `~/.openclaw/secrets/agentic_letters.env`. 4. The attacker extracts the `AGENTIC_LETTERS_API_KEY` bearer token. 5. The attacker submits authenticated requests to the AgenticLetters API, potentially sending letters, consuming paid credits, or querying API-accessible letter information. Exploitation requires local filesystem access and sufficient permission to traverse the victim's home directory. ### Impact Assessment An attacker who obtains the token gains the API capabilities assigned to that token. Based on the audited client, these capabilities include submitting physical letters, listing letters, retrieving letter status, and checking remaining credits. The impact is limited to the AgenticLetters account and API authorization s ...[truncated 231 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create the secrets directory and credential file with explicit owner-only permissions: ```bash install -d -m 700 ~/.openclaw/secrets umask 077 printf '%s\n' 'AGENTIC_LETTERS_API_KEY=al_your_api_key' \ > ~/.openclaw/secrets/agentic_letters.env chmod 600 ~/.openclaw/secrets/agentic_letters.env ``` Additional hardening should include: 1. Prefer an operating-system credential store or secret manager over a plaintext environment file. 2. Validate the permissions and ownership of the credential file before reading it. 3. Refuse to use a credential file owned by another account or writable by group/other users. 4. Document token revocation or rotation procedures for suspected exposure. 5. Advise existing users to apply `chmod 700` to the directory and `chmod 600` to the file. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
agentic_letters.py:165
Finding
Recipient personally identifiable information is stored with default filesystem permissions<![CDATA[ ## Vulnerability Details **File Location**: `agentic_letters.py`, lines 165–190 **Vulnerability Type**: Insecure local storage of sensitive information **Risk Level**: Medium ### Vulnerable Code ```python def _ensure_records_dir() -> Path: p = Path(RECORDS_DIR) p.mkdir(parents=True, exist_ok=True) return p def save_record(send_result: dict, recipient: dict, label: str | None) -> Path: """Save a letter record after successful send.""" records = _ensure_records_dir() letter_id = send_result["id"] date = datetime.now(timezone.utc).strftime("%Y-%m-%d") record = { "id": letter_id, "status": send_result.get("status", "queued"), "type": send_result.get("type", "standard"), "label": label, "recipient": recipient, "created_at": send_result.get("created_at", datetime.now(timezone.utc).isoformat()), "credits_remaining": send_result.get("credits_remaining"), "last_checked": None, } path = records / f"{date}_{letter_id[:8]}.json" path.write_text(json.dumps(record, indent=2, ensure_ascii=False)) return path ``` ### Technical Analysis The Skill stores each recipient's name, street address, postal code, city, country, letter label, delivery status, and identifier in a plaintext JSON record. Neither the records directory nor the generated files are assigned explicit owner-only permissions. Consequently, access controls depend on the process `umask` and existing parent-directory permissions. Under permissive defaults, record files may be readable by other local users. Labels may also reveal sensitive context, such as legal complaints, cancellations, appeals, or data-protection requests. Local record keeping is disclosed in `SKILL.md`, but allowing unrelated local accounts to read those records exceeds the minimum privileges needed to track letter status. ### Attack Path 1. A user sends a letter through the Skill. 2. `_ensure_records_dir()` creates ...[truncated 1023 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Apply explicit owner-only permissions to both the records directory and each record: 1. Create the records directory with mode `0700`. 2. Create record files with mode `0600`, independent of the process `umask`. 3. Correct permissions on existing directories and records during startup. 4. Use atomic file creation and replacement to prevent partial records. 5. Avoid following symbolic links and verify that the destination is an expected regular file. 6. Document data retention and provide a command for securely deleting old records. 7. Consider making local record creation optional when persistent storage is unnecessary. A hardened implementation should use controlled file descriptors, for example `os.open()` with `O_CREAT`, `O_WRONLY`, and an explicit `0o600` mode, followed by an atomic replacement where updates are required. The directory should be created and verified as owned by the current user before any sensitive data is written. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description says the skill sends physical letters in Germany, but the documented behavior also queries account status, lists historical letters, persists local records, and even exposes a country flag inconsistent with the Germany-only claim. This mismatch can mislead users and orchestrators about what data is accessed, stored, and transmitted, causing unauthorized disclosure of recipient data and unintended actions.

Missing User Warnings

High
Confidence
95% confidence
Finding
The skill does not prominently warn that PDFs, recipient names, street addresses, and related metadata will be transmitted to a third-party mailing provider. Because letters often contain legal, identity, or complaint content, omission of this warning undermines informed consent and can expose highly sensitive personal data to an external processor.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares no explicit tool scope even though it uses environment variables, filesystem reads/writes, and network access. Missing scope constraints increases the chance that an agent invokes the skill with broader capabilities than users expect, reducing transparency and weakening least-privilege controls.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger guidance includes broad phrases like 'send a letter' without requiring confirmation, consent, or clear preconditions before sending data to an external service. In an agentic setting, overly permissive triggers raise the risk of accidental invocation and unintended transmission of sensitive documents and addresses.

Session Persistence

Medium
Category
Rogue Agent
Content
## Setup

```bash
mkdir -p ~/.openclaw/secrets
echo 'AGENTIC_LETTERS_API_KEY=al_your_api_key' > ~/.openclaw/secrets/agentic_letters.env
```
Confidence
76% confidence
Finding
The setup instructs storing a long-lived API key in a persistent plaintext file under the user's home directory. While common, this creates session persistence and credential exposure risk if the environment is shared, backed up insecurely, or later accessed by other tools or users.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The skill claims Germany-only delivery, but send_letter and the CLI accept arbitrary country codes and pass them directly to the remote API. This mismatch can cause unauthorized or unintended international mailings, increasing cost and violating user expectations or policy constraints established by the skill description.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The code base64-encodes and transmits the full PDF letter plus recipient name and address to a third-party API, but provides no explicit user-facing disclosure or consent step for this sensitive data transfer. In an agentic workflow, users may assume a local action, so undisclosed off-device transmission creates privacy and compliance risks for personal or confidential correspondence.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The skill description frames the tool as a single-purpose letter-sending capability, but the CLI also exposes account-wide listing and credit-balance operations. In an agent setting, this broadens the accessible privilege surface beyond the declared task, enabling unnecessary access to potentially sensitive account metadata and operational history.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
After sending a letter, the skill stores recipient personal data and metadata in local JSON records under the workspace without warning the user or applying any access protections. This creates a residual privacy risk because names, addresses, and mailing history may remain accessible to other tools, users, or processes on the host.

Static analysis

No suspicious patterns detected.