Back to skill

Security audit

Auto README Generator (ChloePark85)

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple README generator, but users should know it can replace an existing README.md without warning.

Install only if you are comfortable with a tool that writes README.md in the target directory. Before running it, check whether README.md already exists and avoid using it on directories you do not trust unless the script is updated to refuse overwrites and symlinks by default.

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
readme-generator.sh:3
Finding

Unconditional File Overwrite Through Symlink-Following Redirection

Content
View full analysis

Vulnerability Details

File Location: readme-generator.sh, lines 3–8
Vulnerability Type: Unsafe file overwrite and symbolic-link following
Risk Level: Medium

Vulnerable Code

bash
PROJECT_PATH=${1:-.}
PROJECT_NAME=$(basename "$PROJECT_PATH")

README_CONTENT="# $PROJECT_NAME\n\n## Description\n\nThis is a brief description of the project.\n\n## Installation\n\n\`\`\`bash\nnpm install\n# or\npip install -r requirements.txt\n\`\`\`\n\n## Usage\n\n\`\`\`bash\n# Example usage\n\`\`\`\n\n## License\n\nThis project is licensed under the MIT License.\n"

echo -e "$README_CONTENT" > "$PROJECT_PATH/README.md"

Technical Analysis

The output redirection unconditionally truncates and replaces README.md without checking whether the destination already exists or is a symbolic link. Standard shell redirection follows symbolic links. Consequently, if README.md points to another file writable by the invoking user, that target is truncated and replaced with the generated template.

The project path is caller-controlled, but it is quoted correctly, so no command injection was identified. Exploitation instead depends on controlling the destination directory or its existing README.md entry. There is no evidence that this flaw enables privilege escalation beyond the permissions of the account running the script.

Attack Path

  1. An attacker obtains write access to a project directory that a victim is likely to process.
  2. The attacker creates README.md as a symbolic link to another file writable by the victim.
  3. The victim invokes the generator for that project directory.
  4. Shell redirection follows the symbolic link and truncates the linked target.
  5. The generated README content replaces the target file, potentially corrupting data or configuration.

A simpler accidental-loss scenario occurs when a legitimate README.md already exists: running the script replaces it without warning or backup.

...[truncated 507 chars]

Remediation
View remediation

Remediation Suggestions

  • Refuse to overwrite an existing destination by default and require an explicit --force option.
  • Reject symbolic-link destinations before writing, for example with [[ -L "$destination" ]].
  • Create the output in the destination directory using a securely created temporary file and atomically rename it after successful generation.
  • Verify that the project path exists and is a directory.
  • Avoid relying solely on a check followed by ordinary redirection where an untrusted party can modify the directory concurrently, because that introduces a time-of-check/time-of-use race.
  • Preserve or back up existing content when replacement is explicitly requested.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill generates a README.md file but does not clearly warn users that it may create or overwrite an existing README.md in the target directory. This can lead to accidental loss or replacement of project documentation, especially when run in the current working directory by default.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.