T09 · Insecure Skill Coding Practices
- Location
chrome-extension-generator.sh:43- Finding
Unvalidated input permits path traversal, file overwrite, and generated extension content injection
- Content
View full analysis
"$OUTPUT_PATH/manifest.json" << MANIFEST { "manifest_version": 3, "name": "$NAME", "version": "1.0.0", "description": "$DESCRIPTION", "permissions": ["storage"], "action": { "default_popup": "popup.html", "default_icon": "icon.png" }, "background": { "service_worker": "background.js" }, "icons": { "16": "icon.png", "48": "icon.png", "128": "icon.png" } } MANIFEST ``` ```bash cat > "$OUTPUT_PATH/popup.html" << POPUP $NAME body { width: 300px; padding: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } h1 { font-size: 16px; margin: 0 0 12px; } button { width: 100%; padding: 10px; background: #4285f4; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { background: #3367d6; }$NAME
$DESCRIPTION
Click Me POPUP ``` ```bash cat > "$OUTPUT_PATH/README.md" << README # $NAME $DESCRIPTION ``` ### Technical Analysis The extension name is converted to lowercase and spaces are replaced with hyphens, but directory separators, `..` path compon ...[truncated 2677 chars]- Remediation
View remediation
`, ``, and `
`. - Keep user-controlled values out of raw markup and script contexts. 6. **Add negative security tests** - Test names containing `../`, absolute paths, slashes, quotes, newlines, JSON fragments, and HTML tags. - Verify that existing files are never replaced without explicit confirmation. - Verify that generated manifests remain valid JSON for all accepted input. ]]>
