Skip to content

LS-DB-003: PostgreSQL Connection String

Severity CRITICAL
Blast radius Full database compromise
Rotate at https://www.postgresql.org/docs/current/sql-alterrole.html

If this leaks

Contains a username and password for a PostgreSQL database, granting full read/write access to every schema that user can reach.

What to do

  1. Rotate or revoke the credential at https://www.postgresql.org/docs/current/sql-alterrole.html.
  2. Check the provider's audit logs for use you don't recognise.
  3. Remove it from git history (leakscan purge --help) and load it from an environment variable or secret manager instead.

Pattern

postgres(?:ql)?://[^\s'\"]+:[^\s'\"@]+@[^\s'\"]+

Suppress

On one line: # leakscan:ignore LS-DB-003. For the whole project:

disable_rules: [LS-DB-003]