Back to skill

Security audit

Email OTP

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it persistently stores and prints sensitive OTP, verification-link, password, and token data with under-disclosed security tradeoffs and imperfect file permission handling.

Review before installing. Use this only for low-stakes disposable email workflows, avoid routing important account recovery or personal data through it, and delete ~/.tempmail_otp/ after use. Be aware that OTPs, verification links, the mailbox password, and JWT token may remain in plaintext files and terminal output.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tempmail_otp.py:40
Finding
Sensitive state files are created with insufficient permission controls<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/tempmail_otp.py:40-49` - `scripts/tempmail_otp.py:316-318` - `scripts/tempmail_otp.py:348-350` **Vulnerability Type**: Insecure storage of sensitive credentials, OTPs, and verification links **Risk Level**: Medium ### Vulnerable Code ```python def ensure_state_dir(): """Create state directory if it doesn't exist.""" os.makedirs(STATE_DIR, exist_ok=True) def save_state(data: dict): """Save account state to file.""" ensure_state_dir() with open(STATE_FILE, "w") as f: json.dump(data, f, indent=2) os.chmod(STATE_FILE, 0o600) # Restrictive permissions ``` ```python # Save OTP to file ensure_state_dir() with open(LAST_OTP_FILE, "w") as f: f.write(otp) ``` ```python # Save first interesting link if interesting_urls: ensure_state_dir() with open(LAST_LINK_FILE, "w") as f: f.write(interesting_urls[0]) ``` ### Technical Analysis The state directory is created without explicitly enforcing mode `0700`. Its effective permissions therefore depend on the process umask and any pre-existing directory permissions. The account state file contains the temporary mailbox address, plaintext password, and bearer JWT. It is opened and written before `os.chmod(STATE_FILE, 0o600)` is called. Consequently, a newly created file initially receives permissions derived from the ambient umask. This creates a time-of-check/time-of-protection window during which another local user may be able to read it. If writing or serialization fails before `chmod` executes, the file can remain with the initial permissions. The `last_otp` and `last_link` files receive no explicit permission hardening at all. Under a common `022` umask, newly created files ordinarily have mode `0644`, making them readable by other local users. This contradicts the documentation's assertion that all state files use mode `0600`. A verification URL can itself function as a bearer credential. Reading ei ...[truncated 2201 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create and enforce the state directory with owner-only permissions: ```python def ensure_state_dir(): os.makedirs(STATE_DIR, mode=0o700, exist_ok=True) os.chmod(STATE_DIR, 0o700) ``` 2. Use one secure helper for every sensitive state file. Create temporary files atomically with mode `0600`, write and flush the data, and then replace the destination: ```python import tempfile def secure_write(path: str, content: str): ensure_state_dir() fd, temp_path = tempfile.mkstemp(dir=STATE_DIR) try: os.fchmod(fd, 0o600) with os.fdopen(fd, "w") as f: f.write(content) f.flush() os.fsync(f.fileno()) os.replace(temp_path, path) os.chmod(path, 0o600) except Exception: try: os.close(fd) except OSError: pass try: os.unlink(temp_path) except OSError: pass raise ``` 3. Apply the secure writer consistently to: - `account.json` - `last_otp` - `last_link` 4. Validate that the state directory is owned by the current user and is not a symbolic link before storing credentials. 5. Where supported, use no-follow filesystem semantics such as `O_NOFOLLOW` when opening sensitive paths. 6. Avoid printing the plaintext mailbox password by default. Require an explicit option when credential output is necessary, and ensure JSON output is treated as sensitive. 7. Add automated tests that run under permissive umasks and verify that the directory remains `0700` and every sensitive file remains `0600`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (34)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
**Reset all state:**
```bash
rm -rf ~/.tempmail_otp/
```

## OTP Detection Patterns
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
**Reset all state:**
```bash
rm -rf ~/.tempmail_otp/
```

## OTP Detection Patterns
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
**Reset all state:**
```bash
rm -rf ~/.tempmail_otp/
```

## OTP Detection Patterns
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
**Reset all state:**
```bash
rm -rf ~/.tempmail_otp/
```

## OTP Detection Patterns
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python3 scripts/tempmail_otp.py create
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Tool Parameter Abuse

High
Category
Tool Misuse
Content
3. **Cross-session persistence** - Works from any directory on your system
4. **Permission safety** - Sensitive credentials have proper file permissions

To reset all state: `rm -rf ~/.tempmail_otp/`

## Typical Workflow
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Session Persistence

Medium
Category
Rogue Agent
Content
## Quick Start

```bash
# Create a new temporary email
python3 scripts/tempmail_otp.py create

# Use the displayed email for signup, then monitor for OTP
Confidence
72% confidence
Finding
The quick-start flow normalizes automatic saving of OTPs to disk, which creates session persistence for one-time authentication material without emphasizing the security tradeoff. OTPs are highly sensitive, and persisting them beyond immediate use increases the window in which another local process or user could recover and misuse them.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README explicitly states that account credentials, JWT tokens, OTPs, and extracted links are persisted under ~/.tempmail_otp/, but it does not clearly warn users that these artifacts are sensitive and may enable session reuse or account takeover if exposed. Even with 0600 permissions, local compromise, backups, shell history, or multi-user misconfiguration can leak this data.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill describes capabilities that involve file reads/writes, shell execution, and outbound network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it easier for an agent runtime to grant broader access than the skill actually needs, increasing the blast radius if the skill is misused or compromised.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: email-otp
description: Create temporary email addresses and monitor for registration OTP codes or validation links
version: 1.0.0
metadata:
  author: etopro
Confidence
88% confidence
Finding
The skill is intentionally designed for cross-session persistence by storing temporary email account state, credentials, and extracted authentication data under a user home directory. While functional, this creates a retention risk because sensitive registration artifacts remain available beyond the immediate task and may be reused, exfiltrated, or accidentally shared.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill explicitly states that it extracts OTPs, validation links, and stores account credentials and JWT tokens persistently, but it does not provide a clear warning that these are sensitive authentication artifacts. OTPs and session credentials can enable account takeover or unauthorized verification if exposed to other local processes, users, logs, or backups.

Session Persistence

Medium
Category
Rogue Agent
Content
API: https://api.mail.tm

Usage:
    tempmail_otp.py create [-d DOMAIN] [-e EMAIL] [-p PASSWORD]
    tempmail_otp.py check [--timeout SECONDS] [--poll SECONDS] [--sender SENDER] [--subject SUBJECT]
    tempmail_otp.py list
    tempmail_otp.py domains
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The script stores the full temporary mailbox state locally, including the mailbox password and bearer token, and also prints credentials to stdout in normal operation. Even for a temp mailbox, these secrets grant access to inbox contents and any OTPs or account-verification links sent there, so other local users, shell history/logging systems, or downstream tooling may capture them.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:156