Back to skill

Security audit

Adversarial Prompting

Security checks for vulnerabilities and agentic risk

Overview

The skill mainly performs adversarial analysis as advertised, but it automatically saves the full analysis to the user's home directory without opt-in or clear containment.

Review this skill before installing if you may use it on confidential topics. It automatically writes full analyses to your home directory, so users should either remove or modify the export step, make export opt-in, and use a private dedicated output directory with collision-safe file creation.

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/export_analysis.py:20
Finding

Predictable Output File Allows Symlink-Based File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/export_analysis.py, lines 20–30
Vulnerability Type: Predictable file creation, symlink following, and non-exclusive overwrite
Risk Level: Medium

Vulnerable Code

python
# Create filename with timestamp
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
# Sanitize problem_summary for filename
safe_summary = "".join(c for c in problem_summary if c.isalnum() or c in (' ', '-', '_')).strip()
safe_summary = safe_summary.replace(' ', '_')[:50]  # Limit length

filename = f"adversarial_analysis_{safe_summary}_{timestamp}.md"
filepath = Path.home() / filename

# Write content to file
with open(filepath, 'w', encoding='utf-8') as f:

Technical Analysis

The output path is generated from a caller-influenced summary and a timestamp with only one-second precision. This makes the destination filename predictable when the summary and approximate execution time are known.

The file is opened with mode 'w', which follows symbolic links and truncates an existing destination. The implementation does not use exclusive creation, verify that the destination is a regular file, reject symbolic links, or place exports in a dedicated directory with restrictive permissions.

A local attacker who can create entries in the exporting user's home directory could pre-create the predicted output path as a symbolic link to another file writable by that user. When the export runs, Python follows the link and truncates or replaces the target's contents with the generated Markdown. Even without a symbolic link, a filename collision silently overwrites an existing export.

Attack Path

  1. The attacker obtains local access that permits creating a file or symbolic link in the victim's home directory.
  2. The attacker determines or influences problem_summary and predicts the export execution second.
  3. The summary is sanitized using the documented character filtering and ...[truncated 1339 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create exports inside a dedicated directory owned by the invoking user and configured with restrictive permissions such as 0700.
  2. Use unpredictable filenames generated with tempfile, a cryptographically random identifier, or UUID rather than a timestamp alone.
  3. Open new files with exclusive creation mode ('x') and retry with a newly generated name if a collision occurs.
  4. Refuse symbolic-link destinations and, where supported, use low-level file opening with O_CREAT | O_EXCL | O_NOFOLLOW.
  5. If users may select an output path, resolve and validate it against an approved export directory before writing.
  6. Avoid silently truncating an existing file; require explicit user confirmation for replacement.
  7. Perform automatic exports only after informing the user of the destination and obtaining approval when the surrounding execution policy requires it.

A hardened implementation should atomically create a new, unpredictable file within a private export directory and never follow a pre-existing filesystem entry.

Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as an analysis methodology, but its instructions include an operational side effect—exporting results via an external script—that is not transparently aligned with the declared purpose. This mismatch is risky because users and higher-level policy systems may treat the skill as purely analytical while it actually performs persistence actions, enabling stealthy data handling or policy bypass through misleading documentation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs automatic export of analysis output to disk but declares no explicit tool scope or permissions for file-writing behavior. Undeclared persistence is dangerous because it can store sensitive prompts, analyses, or user data without informed consent, and hidden write capability increases the attack surface for data leakage or unexpected side effects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest and body describe a reasoning framework, but the instructions also require automatic export to a markdown file, introducing a side effect unrelated to the core analysis task. In context, this makes the skill more dangerous because adversarial analysis may process sensitive or proprietary user content, which would then be silently persisted to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatically exporting the complete analysis to a file without warning the user creates an undisclosed data persistence channel. Because the skill is designed to analyze arbitrary problems, the saved output may contain confidential business, security, or personal information, making silent disk writes especially risky in this context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The documentation says the analysis will be presented to the user, then adds an instruction to use an external export script without adequately describing that behavior as part of the skill. While lower severity, undocumented external script invocation can obscure execution flow and create trust gaps around where content goes and what additional code runs.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.