T09 · Insecure Skill Coding Practices
- Location
scripts/generate-project.py:26- Finding
Unrestricted Recursive Deletion of a User-Selected Output Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly does what it says, but it needs review because it can delete an arbitrary chosen output directory and generates a web service with exposed unsafe defaults and vulnerable dependencies.
Use this only in a disposable or clearly chosen workspace, and do not point the generator at an existing project, home directory, repository root, or any sensitive path. Before deploying the generated site, update dependencies, add lockfiles or hashes, restrict CORS, bind the backend appropriately, protect or rate-limit /api/refresh, and review how to stop Docker containers or local background processes.
scripts/generate-project.py:26Unrestricted Recursive Deletion of a User-Selected Output Directory
templates/backend-main.py:145Unauthenticated Refresh Endpoint Permits Remote Resource Exhaustion
templates/backend-main.py:14Overly Permissive Cross-Origin Resource Sharing Configuration
templates/start.sh:68Runtime Dependency Installation Without Lockfiles or Integrity Verification
The manifest pins Next.js to exactly 15.0.0, and the static analysis reports multiple known advisories against that precise version, including critical issues such as unauthenticated remote code execution and middleware/proxy bypasses. In a web application generator, shipping a template with a known vulnerable framework version can directly propagate exploitable flaws into generated sites.
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
python-multipart==0.0.6 is an old version with multiple reported multipart parsing denial-of-service issues, including Content-Type header ReDoS and malformed boundary handling. In a FastAPI backend, this package is especially relevant because it is commonly used to process form-data and file uploads, so a remote attacker may be able to trigger excessive CPU or resource consumption with crafted requests.
The skill instructs the user to run a local Python generator, create a full project tree, use Docker Compose, and access network resources, but it does not declare any explicit tool scope such as permissions or allowed-tools. That omission weakens transparency and reviewability, making it easier for a consumer or agent to invoke file writes, shell execution, and network activity without clear prior authorization boundaries.
The generated layout sets <html lang="zh-CN">, and surrounding generated content and user-facing strings are also Chinese-centric. This imposes a specific language/locale on all generated projects without opt-in, which matches the policy-violation category for forced language or locale.
The code explicitly formats dates using the 'zh-CN' locale, and the visible interface text throughout the page is Chinese-only. This creates a natural-language/locale policy issue because the skill imposes a specific language and locale without user opt-in or a documented regional justification.
This shell script presents its user-facing interface entirely in Chinese, beginning with the title banner and continuing throughout prompts and status messages. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the restriction is clearly documented and justified.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
# 启动后端(后台)
echo "启动后端服务 (端口 8000)..."
nohup python3 -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload > backend.log 2>&1 &
BACKEND_PID=$!
echo "后端 PID: $BACKEND_PID"
The skill tells the user to run a generator script and then start the resulting stack with docker-compose, but it does not clearly warn that these actions will create files on disk and launch persistent local services and containers. This is dangerous mainly from a safety and consent perspective: users may trigger system changes, port bindings, or background workloads without understanding the local side effects.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"lint": "next lint"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.0.0"
},
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.0.0"
},
"devDependencies": {
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"next": "15.0.0"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
"postcss": "^8",
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
"postcss": "^8",
"autoprefixer": "^10.0.1"
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
"postcss": "^8",
"autoprefixer": "^10.0.1"
}
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
"postcss": "^8",
"autoprefixer": "^10.0.1"
}
}
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"@types/react-dom": "^19",
"tailwindcss": "^3.4.0",
"postcss": "^8",
"autoprefixer": "^10.0.1"
}
}
Detected: suspicious.env_credential_access