Back to skill

Security audit

OGT Docs Create

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward documentation-creation skill with no hidden execution, though its sample shell script should validate names before use.

Before installing or using this skill, treat it as a docs workflow helper. If you copy the batch shell script, add slug validation and quote path variables so unusual names cannot write outside the intended docs folders.

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
SKILL.md:255
Finding
Unvalidated Feature Slug Permits Filesystem Path Traversal<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 255-294 **Vulnerability Type**: Unvalidated input in filesystem paths **Risk Level**: Medium ### Vulnerable Code ```bash FEATURE=$1 # Create feature definition mkdir -p docs/define/features/$FEATURE cat > docs/define/features/$FEATURE/feature.md << EOF # Feature: $(echo $FEATURE | tr '-' ' ' | sed 's/\b\(.\)/\u\1/g') ## Summary TODO: Add summary ## User Stories As a user, I want to TODO, so that TODO. EOF # Create initial tasks for task in "design" "implement" "test" "document"; do mkdir -p docs/todo/pending/${FEATURE}-${task} cat > docs/todo/pending/${FEATURE}-${task}/task.md << EOF # Task: $(echo $FEATURE | tr '-' ' ' | sed 's/\b\(.\)/\u\1/g') - $(echo $task | sed 's/\b\(.\)/\u\1/g') ## Summary ${task^} the $FEATURE feature. ## Objectives - TODO ## Acceptance Criteria - [ ] TODO EOF echo "medium" > docs/todo/pending/${FEATURE}-${task}/.priority done echo "Created feature: $FEATURE" echo "Created tasks: ${FEATURE}-design, ${FEATURE}-implement, ${FEATURE}-test, ${FEATURE}-document" ``` ### Technical Analysis The batch-creation script assigns its first positional argument directly to `FEATURE` and subsequently incorporates that value into directory and output-file paths. Although the surrounding documentation requires feature names to follow a lowercase slug format, the script does not enforce that policy. A value containing path traversal components such as `../` can cause the normalized destination to escape `docs/define/features/`. For example, the feature-definition operations effectively resolve paths of the following form: ```text docs/define/features/<attacker-controlled-value>/feature.md ``` The expansions are also unquoted. Consequently, shell word splitting and pathname expansion can alter arguments supplied to commands such as `mkdir`, producing unexpected directories or failed and ambiguous redirections. This issue does not permit shell metacharacters ...[truncated 1777 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require an argument and validate it against the documented slug format before performing any filesystem operation: ```bash set -euo pipefail FEATURE=${1:?Usage: $0 <feature-slug>} if [[ ! $FEATURE =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then echo "Invalid feature slug: use lowercase letters, digits, and single hyphens." >&2 exit 1 fi if ((${#FEATURE} > 30)); then echo "Invalid feature slug: maximum length is 30 characters." >&2 exit 1 fi ``` 2. Quote every variable expansion used as a command argument or redirection path: ```bash feature_dir="docs/define/features/$FEATURE" mkdir -p -- "$feature_dir" cat > "$feature_dir/feature.md" <<EOF # Feature: $FEATURE EOF for task in design implement test document; do task_dir="docs/todo/pending/${FEATURE}-${task}" mkdir -p -- "$task_dir" cat > "$task_dir/task.md" <<EOF # Task: $FEATURE - $task EOF printf '%s\n' medium > "$task_dir/.priority" done ``` 3. Resolve and verify destination paths before writing when stronger containment is required. Confirm that each normalized destination remains beneath the intended project directory. 4. Refuse to overwrite existing files unless replacement is explicitly requested. For example, check for an existing `feature.md` and exit safely. 5. Add automated negative tests covering traversal strings, absolute paths, whitespace, wildcard characters, empty arguments, excessive length, and malformed hyphen placement. ]]>
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

Static analysis

No suspicious patterns detected.