T09 · Insecure Skill Coding Practices
- Location
scripts/generate_database_doc.py:187- Finding
Documented TLS Settings Are Not Applied to PostgreSQL Connections
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mainly matches its database-documentation purpose, but it ships real-looking historical credentials and broad cleanup tooling that can rewrite or delete project files.
Do not install this package as-is in a sensitive environment. Ask the maintainer to fully redact historical credential material, remove or isolate the credential-cleanup utility, stop accepting passwords on the command line, correctly enforce TLS settings, secure output-file permissions, sanitize spreadsheet cells, and update vulnerable development tooling. If you still test it, use a disposable environment, a read-only database account, protected environment variables or a secrets manager, and a private output directory.
scripts/generate_database_doc.py:187Documented TLS Settings Are Not Applied to PostgreSQL Connections
scripts/generate_database_doc.py:301Database Passwords Can Be Supplied Through Process Arguments
scripts/generate_database_doc.py:242Generated Database Documentation Is Not Protected with Restrictive File Permissions
scripts/generate_database_doc.py:25Untrusted Database Metadata Can Be Exported as Active Spreadsheet Formulas
EMERGENCY_RESPONSE.md:76Previously Exposed Database Credential Material Remains in Distributed Documentation
scripts/clean_credentials.py:73Credential Cleanup Utility Creates Plaintext Backups Containing the Secrets It Removes
The file pins black to 24.1.1, which is flagged with known vulnerabilities including a Regular Expression Denial of Service issue. In this skill context, Black is a development tool, so exploitation is less severe than a production dependency, but it can still be abused in CI or developer workflows by feeding crafted source files that cause excessive processing or denial of service.
The file pins virtualenv to 20.25.0, which is reported as vulnerable to command injection in activation scripts and TOCTOU issues in directory creation. Even as a development dependency, this is dangerous because virtualenv is commonly executed on developer systems and CI runners; if an attacker can influence environment names, paths, or script generation/consumption, it can lead to code execution in trusted build environments.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- API keys/tokens
- SSH private keys
- Encryption keys
- Personal access tokens
- Certificate private keys
- Authentication cookies/sessions
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
--prune-empty --tag-name-filter cat -- --all
git push origin --force --all
3. **Audit Access Logs**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Update all configuration files
find . -name "*.py" -o -name "*.json" -o -name "*.yaml" -o -name "*.env" | xargs grep -l "192.168.3.87\|monitor_inform_test\|Edan@edan"
# Update environment variables
sed -i 's/192.168.3.87/NEW_HOST/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
find . -name ".py" -o -name ".json" -o -name ".yaml" -o -name ".env" | xargs grep -l "192.168.3.87|monitor_inform_test|Edan@edan"
sed -i 's/192.168.3.87/NEW_HOST/g' .env sed -i 's/monitor_inform_test/NEW_DATABASE/g' .env
The command export $(grep -v '^#' .env | xargs) unsafely loads secrets from a plaintext file using shell parsing that can mis-handle spaces, quotes, or shell-special characters. In addition to reliability issues, this pattern can leak secrets through shell history, process inspection, or unintended shell evaluation in some environments, making credential handling weaker than necessary.
EOF
export $(grep -v '^#' .env | xargs)
### 3. Configure Git Ignore
The skill appears to inspect local source files, environment variables, JSON configs, file permissions, and installed packages while presenting itself as a database documentation generator. Accessing these sensitive local resources without clear necessity creates a path for credential exposure and over-collection of host information.
The skill appears to inspect local source files, environment variables, JSON configs, file permissions, and installed packages while presenting itself as a database documentation generator. Accessing these sensitive local resources without clear necessity creates a path for credential exposure and over-collection of host information.
The development dependency pins pytest to 8.0.0, which is reported as affected by a tmpdir-handling vulnerability. Although this is a dev-only package rather than application runtime code, compromised test execution or unsafe temporary-directory behavior can still affect CI environments, local developer machines, or test artifacts if an attacker can influence filesystem state.
This script is unrelated to the stated purpose of a PostgreSQL database documentation generator and performs repository-wide content rewriting instead. Even if framed as hygiene tooling, bundling a credential-scrubbing utility into an unrelated skill increases the chance of unauthorized file modification, concealment of embedded secrets, or accidental destruction of evidence during normal skill use.
The script recursively scans the repository, rewrites matching files, creates backup copies, and can bulk-delete all .bak files after a prompt. In the context of a database documentation skill, this broad file-modification and deletion capability is unjustified and dangerous because it can alter unrelated project files, erase recovery artifacts, and interfere with audits or incident response if triggered by a user or integrated workflow.
This section includes operational recovery commands such as backups and in-place configuration edits that could alter production systems, but it does not clearly warn readers about prerequisites, environment validation, or the risk of running them blindly. In a skill artifact, users may copy-paste these commands during an incident, increasing the chance of accidental damage, data leakage, or unsafe changes under pressure.
The markdown includes rm -rf venv-database-docs, pip uninstall -y, and pip cache purge, which can remove environments, packages, and cached artifacts. Although the section is labeled 'Safe Removal,' it does not explicitly warn users that these actions are destructive and should be run only against the intended environment.
The README uses broad natural-language invocation examples like generating documentation for a table without clearly constraining when the skill should activate or what exact parameters are required. In an agent environment, this can cause over-broad triggering, accidental handling of sensitive database tasks, or confusion between ordinary conversation and a request to access database-connected functionality.
The additional examples include ambiguous free-form requests and inline credential-style text, which may encourage unsafe prompting patterns and overly permissive skill invocation. In a tool-using agent, this increases the chance of unintended activation, mishandling of secrets supplied in conversational text, or execution against the wrong database scope.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Set restrictive permissions:
chmod 600 /path/to/secure-config.json
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Set restrictive permissions:
chmod 600 /path/to/secure-config.json
The skill declares no explicit tool scope despite instructing use of environment variables and file read/write operations. In an agent setting, missing capability declarations weakens least-privilege controls and can cause the runtime to grant broader access than users expect.
The output description specifies column headers in Chinese characters only: 代码, 数据类型, 长度, 强制, 注释. This imposes a specific language on generated output without user opt-in or a documented regional justification, which matches the language/locale policy violation criteria.
No suspicious patterns detected.