You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Password logged in plaintext in "malformed dsn" error (DATA_SOURCE_PASS with a space) #1408
Ran the exporter with the connection split across DATA_SOURCE_URI, DATA_SOURCE_USER and DATA_SOURCE_PASS, using a password that contains a space (a dummy value here):
The redaction is applied to the URL, but the error string from the DSN parser is passed through verbatim. Anyone who ships container logs to a central log store (Loki, Elasticsearch and similar) gets the database password there.
There are two separate problems:
The password is not redacted in the wrapped "malformed dsn" error.
A password containing a space is not accepted when it comes from DATA_SOURCE_PASS, even though it is valid in PostgreSQL. This looks like the same underlying issue as Passwords with blanks are not working #393, which was closed in July 2026 without a fix. It is the trigger that makes the parser error, and with it the leak, appear.
The same parser error is the one quoted in #393 (malformed dsn "... password=..."), so the leak itself is already visible publicly in that issue.
Environment
System information:
Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 (Docker)
postgres_exporter version:
postgres_exporter, version 0.20.1 (branch: HEAD, revision: 867fbca)
postgres_exporter flags:
(none; image defaults)
PostgreSQL version:
Not relevant. The error occurs before any connection is attempted. Also seen against PostgreSQL 18.6.
Activity