T09 · Insecure Skill Coding Practices
- Location
install.sh:124- Finding
Arbitrary Python Code Execution Through Installer Path Injection
- Content
View full analysis
/dev/null; then python3 -c " import yaml import sys try: with open('$TARGET_DIR/$SKILL_NAME/SKILL.md', 'r', encoding='utf-8') as f: content = f.read() if content.startswith('---'): _, frontmatter, _ = content.split('---', 2) data = yaml.safe_load(frontmatter) print('📋 Skill information:') print(f' Name: {data.get(\"name\", \"N/A\")}') print(f' Description: {data.get(\"description\", \"N/A\")[:60]}...') print('') print('✅ Skill format validation passed') else: print('⚠️ SKILL.md format may be invalid') except Exception as e: print(f'⚠️ Validation warning: {e}') " ``` ### Technical Analysis `TARGET_DIR` is attacker-controllable because it is assigned directly from `$1`. Although shell variable expansion occurs inside a double-quoted shell string, the expanded value is inserted into a single-quoted Python string literal inside the `python3 -c` program. Shell quoting therefore does not make the value safe for the Python parser. A target directory containing a single quote and additional Python syntax can terminate the intended string literal and introduce an expression or statement that Python evaluates. For example, a ...[truncated 2438 chars]- Remediation
View remediation
