T09 · Insecure Skill Coding Practices
- Location
SKILL.md:18- Finding
Database Access Configured with a Blank Password
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 18–34 and 164–170
Vulnerability Type: Insecure database authentication configuration
Risk Level: MediumVulnerable Code
bash # Connect to pgvector database (default port 5433) psql -h localhost -p 5433 -U damien -d postgres # Or use environment variables export PGHOST=localhost export PGPORT=5433 export PGUSER=damien export PGPASSWORD='' export PGDATABASE=postgresmarkdown - **Host**: localhost - **Port**: 5433 - **User**: damien - **Password**: (empty) - **Database**: postgrespython conn = psycopg2.connect( host="localhost", port=5433, user="damien", password="", database="postgres" )Technical Analysis
The Skill consistently demonstrates PostgreSQL access through a fixed user account with an explicitly blank password. If the corresponding deployment permits passwordless access—for example, through a permissive
pg_hba.confrule, trust authentication, or equivalent local configuration—database authentication depends primarily on the caller's ability to reach the service.The examples also normalize an insecure pattern that users may copy into production code or automation. Although the documented endpoint is limited to
localhost, any untrusted process running on the same host may be able to attempt the connection. The actual exploitability and resulting privileges depend on PostgreSQL authentication rules and the permissions assigned to thedamienrole.Attack Path
- An attacker obtains the ability to run a process on the database host, such as through another local account, compromised service, or container with access to the host loopback service.
- The attacker connects to
localhost:5433, requests thedamienrole, and supplies no password. - If PostgreSQL is configured to accept passwordless authentication for that connection, the attacker re ...[truncated 869 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all blank-password examples and require a strong, non-empty database credential.
- Retrieve credentials from a protected environment variable or secret manager rather than embedding them in documentation or source code.
- Configure PostgreSQL to use SCRAM-SHA-256 authentication and remove permissive
trustrules for application connections. - Create a dedicated application role instead of using a personal or broadly privileged account.
- Grant only the required permissions on the specific database, schema, tables, and sequences; do not grant superuser, role-management, or unrestricted schema-creation privileges.
- Restrict network access with PostgreSQL listen settings, host firewall rules, and narrowly scoped
pg_hba.confentries. - Update the Python example to fail when the credential is absent, for example by reading
PGPASSWORDfrom the environment and validating that it is non-empty. - Rotate the database credential if the documented passwordless setup has already been deployed, and review database logs for unauthorized local connections.
