T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Predictable Hardcoded Database Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This deployment skill is coherent in purpose but asks users to run broad privileged setup steps that can overwrite system web-server configuration and use weak deployment practices.
Review every command before running it. Use a disposable WSL2 instance or take a backup first, generate unique database credentials, pin repository commits and dependency versions, avoid replacing the global Nginx config for one app, and do not delete existing enabled sites unless you know they are unused.
SKILL.md:47Predictable Hardcoded Database Credential
SKILL.md:29Execution of Unpinned and Mutable Third-Party Code
SKILL.md:142Privileged Replacement of Global Nginx Configuration with Unpinned Repository Content
The command unconditionally deletes /etc/nginx/sites-enabled/default, which is a destructive system modification that can disable existing web content or service routing. In a skill intended for broad deployment help, removing a live config without backup or environment checks can cause outage or erase local customizations.
sudo cp ~/workdir/FastapiAdmin/devops/nginx/nginx.conf /etc/nginx/nginx.conf
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo nginx
sudo nginx -t && sudo nginx chains validation and service start in one line, encouraging immediate execution after a single check and making rollback or operator review less likely. In deployment docs that already overwrite global nginx config, this pattern increases the chance of rapidly applying a bad or unsafe configuration to a live system.
sudo cp ~/workdir/FastapiAdmin/devops/nginx/nginx.conf /etc/nginx/nginx.conf
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo nginx
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
hostname -I | awk '{print $1}'
# Nginx 配置测试与重载
sudo nginx -t && sudo nginx -s reload
# 查看 Nginx 错误日志
sudo tail /var/log/nginx/error.log
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
修复:
cat > frontend/.env.production << 'EOF'
VITE_APP_ENV=production
VITE_APP_TITLE=FastapiAdmin
VITE_API_BASE_URL=http://<WSL2_IP>
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
修复:
cat > frontend/.env.production << 'EOF'
VITE_APP_ENV=production
VITE_APP_TITLE=FastapiAdmin
VITE_API_BASE_URL=http://<WSL2_IP>
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
修复:
cat > frontend/.env.production << 'EOF'
VITE_APP_ENV=production
VITE_APP_TITLE=FastapiAdmin
VITE_API_BASE_URL=http://<WSL2_IP>
The skill directs package installation, service startup, configuration replacement, and other system-modifying actions without an upfront warning about privileged operations and host impact. In a deployment skill, this increases the chance an operator or agent executes broad changes on the wrong machine or without understanding the security consequences.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
npm install -g pnpm
# 安装 MySQL + Redis + Nginx
sudo apt-get update
sudo apt-get install -y mysql-server redis-server nginx
# 安装 python3-venv(venv 创建必需)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get install -y python3.12-venv
sudo service mysql start sudo service redis-server start