Skip to content

Track primary_conninfo password exposure in pg_meta_info (deferred) #111

Open

Description

@Vonng

Current status — 2026-11-12 / v1.6.1: confirmed, implementation deferred. The pg_meta_info.primary_conninfo label still contains the SQL setting value without redaction. The existing maintainer decision and password-free primary_conninfo deployment policy remain in force; no fix version is scheduled. v1.6.1 diagnostic-URL redaction does not sanitize this metric label.


Original report

The default PostgreSQL 13+ pg_meta collector reads current_setting('primary_conninfo', true) and exports the complete value as the primary_conninfo label on pg_meta_info. If the setting contains a password, anyone who can read those metrics can read the password, and a monitoring system may retain it as part of a time series.

This was reproduced on PostgreSQL 18.6 with the default collector configuration and a non-superuser monitoring account granted pg_monitor. A synthetic password placed in primary_conninfo appeared verbatim in /metrics. No real credentials were used. The existing DSN masking used for exporter diagnostics does not apply to values returned by collector SQL.

Maintainer position: accepted for now; implementation deferred. Our intended production policy is to keep passwords out of primary_conninfo, using a protected passfile or another supported authentication mechanism. We do not currently plan to add special handling for this label or make this issue a blocker for the next small release. This issue records the risk and that decision.

That deployment policy is an assumption, rather than a PostgreSQL restriction: PostgreSQL explicitly permits a password in primary_conninfo. The existing HELP text saying “do not set password here” documents the expectation but does not enforce it.

If we revisit this, first decide whether to retain only safe connection fields, replace the raw value, or remove the label with a compatibility plan. Any redaction must handle libpq quoting and escaping correctly. Review the legacy collectors as well, and update the source YAML, generated configuration, and operator guidance together. Existing installations may retain their old collector configuration when upgrading the binary.

Source: modern pg_meta collector and legacy pg_meta collector. The legacy exposure depends on what the monitoring role can read; the live reproduction above used the modern configuration.

Reviewed on 2026-11-09 against main at 9d9804f. The relevant behavior is also present in v1.5.0.

Activity

  1. Vonng commented on Nov 11, 2026

    @Vonng
    MemberAuthor

    Still present in the v1.6.1 collector: the SQL selects current_setting('primary_conninfo', true), and the result remains a label on pg_meta_info.

    The v1.6.1 sslpassword change masks diagnostic connection URLs only; it does not redact SQL result labels. The maintainer's recorded deferral remains the decision for this issue. Keep credentials out of primary_conninfo, use a protected passfile or another suitable authentication method, and control access to metrics and their storage.

    Keeping this open as a deferred security-related issue, with no scheduled release. This has not been marked fixed. Status reviewed on 2026-11-12 against v1.6.1 and current main (f1de039).

  2. added this to the Backlog milestone on Nov 11, 2026
  3. added
    bug
    status: deferred
    security
    on Nov 11, 2026
  4. self-assigned this
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsecuritystatus: deferred

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions