T09 · Insecure Skill Coding Practices
- Location
references/connections.md:185- Finding
Insecure PgBouncer Example Exposes the Service on All Network Interfaces with Legacy Authentication
- Content
View full analysis
Vulnerability Details
File Location:
references/connections.md:185-192
Vulnerability Type: Insecure database proxy configuration
Risk Level: MediumVulnerable Code
ini [databases] mydb = host=localhost port=5432 dbname=mydb [pgbouncer] listen_addr = * listen_port = 6432 auth_type = md5 auth_file = /etc/pgbouncer/userlist.txtTechnical Analysis
The document presents this PgBouncer configuration as a “GOOD” example, but
listen_addr = *binds the service to every available network interface. This provides broader network exposure than is necessary for a typical local pooling example. The configuration also selects the legacymd5authentication mechanism and does not require TLS or network-level access restrictions.Because this is reference documentation rather than an active configuration file, it does not directly expose the system running the Skill. The security risk arises when a user copies the recommended configuration into a deployment. If port 6432 is reachable from an untrusted network, remote clients can interact with the authentication endpoint. Legacy authentication and absent transport-security guidance increase the risk of credential attacks or interception on an untrusted network.
The flagged HTTP requests elsewhere in
references/connections.mdtarget the reservedapi.example.comexample domain and do not send database results or credentials. They are illustrative, non-executing examples and are not a confirmed data-exfiltration vulnerability.Attack Path
- An operator copies the configuration identified as a good practice into a PgBouncer deployment.
- PgBouncer binds port 6432 to all host interfaces through
listen_addr = *. - A firewall, security group, or local network permits an untrusted party to reach that port.
- The attacker connects to PgBouncer and performs account enumeration, password guessing, or credential-reuse attacks against the leg ...[truncated 1039 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
listen_addr = *with127.0.0.1,::1, or a specific trusted private interface unless wildcard binding is explicitly required. - Use
auth_type = scram-sha-256with properly generated SCRAM credentials rather than legacy MD5 authentication. - Require TLS for connections that cross host boundaries and validate certificates according to the deployment's trust model.
- Restrict port 6432 using host firewalls, security groups, and network allowlists so that only authorized application systems can connect.
- Run PgBouncer under a dedicated, unprivileged operating-system account.
- Grant application database roles only the minimum schema and operation privileges they require.
- Add authentication rate limiting or network-layer controls and monitor failed login attempts.
- Revise the documentation so the hardened configuration is the default example. If wildcard binding is retained for demonstration purposes, mark it as unsafe unless accompanied by explicit network restrictions.
- Include a deployment verification step confirming that port 6432 is not exposed to public or otherwise untrusted networks.
- Replace
