Summary
pgEdge Control Plane generated PostgreSQL access rules that trusted Unix-socket and loopback connections before operator-supplied rules. In systemd deployments, an unprivileged local account on a database host could connect as any PostgreSQL role, including a superuser, without credentials.
Affected context
The issue affects pgEdge Control Plane versions 0.1.0 through 0.10.1 when generated pg_hba.conf files contain hard-coded trust entries ahead of operator-supplied rules.
Under the systemd orchestrator, local operating-system accounts on a database host could reach the trusted Unix socket or loopback connection. Under Docker Swarm, reaching the container-local socket or loopback required code execution inside the database container; publishing the PostgreSQL port alone did not expose these rules to host connections.
Exploit preconditions
- Attack surface: PostgreSQL Unix-socket or loopback connections covered by the generated trust rules
- Required access: Under systemd, an unprivileged account on the database host; under Docker Swarm, access sufficient to execute code inside the database container
- Trigger point: Authentication to PostgreSQL through a connection matched by a hard-coded trust entry
- Why exploitation is possible: PostgreSQL evaluates host-based authentication rules from top to bottom, so the early trust entries can bypass credentials and preempt operator-supplied rules
Why this happens
The generated pg_hba.conf placed permissive trust rules before operator-configured rules. Since PostgreSQL applies the first matching rule, those entries allowed connections without authentication rather than enforcing the intended access controls.
This maps primarily to CWE-306: Missing Authentication for Critical Function. The insecure default configuration also relates to CWE-1188: Initialization of a Resource with an Insecure Default, because generated authentication settings began in an overly permissive state.
Potential impact
- An attacker with the required local or container access could authenticate as a PostgreSQL role without credentials.
- A connection as a PostgreSQL superuser could allow database-wide administration and data access.
- An attacker could alter or delete database data, accounts, or configuration.
General mitigation guidance
Mitigation generally focuses on ensuring generated authentication rules are secure by default and cannot silently override operator intent.
Common defensive patterns include:
- Avoiding trust-based authentication for sensitive database roles and connections.
- Ensuring generated rules preserve intended operator policies and are ordered according to explicit precedence.
- Validating effective authentication behavior after configuration generation.
- Restricting local operating-system and container access, and running workloads with least privilege.
- Limiting database exposure to the networks and identities that require access.
How teams detect issues like this
High-level detection approaches include:
- Reviewing generated
pg_hba.conffiles for early trust rules covering Unix sockets, loopback addresses, or privileged roles. - Comparing effective rules with operator-supplied configuration and checking rule order.
- Using static analysis or configuration policy checks to flag permissive authentication defaults.
- Auditing database connections and role activity for unexpected local superuser access.

