Back to skill

Security audit

Auto Paper Writer

Security checks for vulnerabilities and agentic risk

Overview

The skill is an academic paper generator, but its cleanup step can delete unrelated scripts and presentations from the user's Desktop.

Review this skill carefully before installing. Its research and writing steps are generally coherent, but do not allow the cleanup commands as written; they should be changed to delete only files created inside a dedicated paper workspace, preferably after showing the exact files and asking for confirmation.

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

Error
Location
SKILL.md:178
Finding

Desktop-Wide Wildcard Cleanup Can Delete Unrelated User Files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 178-184
Vulnerability Type: Excessively broad and destructive file cleanup
Risk Level: High

Vulnerable Code

powershell
### Step 8: Clean temporary files
After completing the paper, **delete all temporary script files**:
- Search scripts (`search_*.ps1`)
- Download scripts (`download_*.ps1`)
- Figure-generation scripts (`generate_*.py`)
- Other intermediate files

```powershell
Remove-Item "$env:USERPROFILE\Desktop\*.ps1" -Force
Remove-Item "$env:USERPROFILE\Desktop\*.py" -Force
Remove-Item "$env:USERPROFILE\Desktop\*_v*.pptx" -Force
text

### Technical Analysis

The cleanup commands apply wildcard deletion to the user's entire Desktop rather than to a dedicated workspace or an explicit list of files generated by the Skill. The patterns `*.ps1` and `*.py` match every PowerShell and Python script on the Desktop, while `*_v*.pptx` may match unrelated presentations.

The commands also use `-Force`, suppressing protections that might otherwise prevent deletion of hidden or read-only matching files. No ownership check, generated-file manifest, path containment validation, confirmation prompt, or recovery mechanism is present.

This violates least-destructive-operation principles. The Skill only needs to remove its own temporary files, but the documented operation affects files outside the paper output directory.

### Attack Path

1. A user has unrelated `.ps1`, `.py`, or matching `*_v*.pptx` files on their Desktop.
2. The user invokes the Auto Paper Writer Skill.
3. The Agent follows the workflow through Step 8.
4. The Agent executes the documented `Remove-Item` commands.
5. PowerShell expands the wildcards across the entire Desktop.
6. All matching files are forcibly deleted, including files that were not created by the Skill.

No attacker-controlled input is required; ordinary execution of the documented workflow is sufficient to trigger the vulnerability.

### Impact Assessment

The 
...[truncated 550 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create all temporary files inside a dedicated per-run workspace under the paper directory.
  2. Maintain an explicit manifest of files created during the current run.
  3. Delete only manifest entries instead of using Desktop-wide wildcard patterns.
  4. Resolve and validate every deletion target before removal, ensuring it remains inside the expected workspace.
  5. Reject path traversal and symbolic-link or reparse-point escapes.
  6. Remove -Force unless it is strictly required for a validated, Skill-owned file.
  7. Prefer deleting the dedicated temporary directory after verifying its canonical path and ownership.
  8. Log the exact files selected for deletion and, where practical, request confirmation.

A safer PowerShell pattern would be:

powershell
$tempDir = Join-Path $paper_dir ".auto-paper-writer-temp"
$resolvedPaperDir = [System.IO.Path]::GetFullPath($paper_dir)
$resolvedTempDir = [System.IO.Path]::GetFullPath($tempDir)

if (
    $resolvedTempDir.StartsWith(
        $resolvedPaperDir + [System.IO.Path]::DirectorySeparatorChar,
        [System.StringComparison]::OrdinalIgnoreCase
    ) -and
    (Test-Path -LiteralPath $resolvedTempDir -PathType Container)
) {
    Remove-Item -LiteralPath $resolvedTempDir -Recurse
}

The implementation should additionally ensure the temporary directory is not a symbolic link or reparse point before recursively deleting it.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (9)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises an academic-paper pipeline, but later includes destructive Desktop cleanup unrelated to that stated purpose. This mismatch hides dangerous side effects from users and increases the chance they trigger the skill without understanding it may delete unrelated files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The cleanup step uses broad wildcards against the entire Desktop, deleting any .ps1, .py, and matching .pptx files regardless of whether this skill created them. That can destroy unrelated user files and scripts, causing data loss well beyond the paper-generation workflow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The text claims only temporary script files will be removed, but the actual commands delete any matching files on the Desktop. This discrepancy makes the behavior misleading and dangerous because legitimate user scripts and presentations can be deleted even if they were never created by the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs destructive deletion without any user warning or confirmation, increasing the likelihood of accidental data loss. In context, the deletion scope is broad and targets a common user directory, which makes this especially dangerous.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says the skill triggers when the user says phrases like "自动写论文" and especially "生成论文", which are broad natural-language requests rather than narrowly scoped invocations. The file does not provide exclusion conditions or negative examples to clarify when these phrases should not activate the skill, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest description defines invocation examples and operational description entirely in Chinese, indicating a language-specific interaction model without offering the user a language choice or stating that the skill is region-specific. This can violate language/locale policy when a skill imposes a specific language by default rather than via user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file title and the surrounding instructional content are presented entirely in Chinese, which effectively imposes a language choice on users. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The title and content indicate the skill instructs users in Chinese throughout, which can amount to forcing a specific language without user opt-in. The file does not mention that the language is optional, user-selected, or required for a documented regional/compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, which can constitute a language/locale policy issue when no opt-in or alternative language option is provided. The content does not state that the template is intended only for a Chinese-speaking audience or a region-specific use case.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.