---
title: "NET-DB-004 PostgreSQL Trust and Broad Client Access"
canonical: https://openvapt.com/checks/NET-DB-004.html
html: https://openvapt.com/checks/NET-DB-004.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# NET-DB-004 PostgreSQL Trust and Broad Client Access

PostgreSQL accepts trust authentication or unrestricted client networks.

- Domain: Network
- Severity: Critical
- Control category: Data Services
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- CIS Controls v8: 3.3
- NIST CSF 2.0: PR.AA-05, PR.DS-01
- CWE: CWE-306, CWE-1188
- OWASP Top 10 2021: A05:2021
- NIST SP 800-53 Rev. 5: AC-3, CM-6, SC-7
- Benchmark topic: Secure data service configuration (topic only, no benchmark text)

## Why It Matters

Trust authentication and all-address client rules can allow database access without a password from untrusted networks.

## How It Detects

Reads postgresql.conf and pg_hba.conf, flags listen_addresses '*' or 0.0.0.0, trust methods, and 0.0.0.0/0 or ::/0 client ranges.

## How to Fix

Bind PostgreSQL to required interfaces only and replace trust or unrestricted pg_hba.conf rules with narrow CIDRs and scram-sha-256. Caution: users whose passwords are stored as md5 cannot log in with scram-sha-256 until their password is set again with password_encryption = scram-sha-256, so reset them first and reload, not restart, to test.

## How to Verify

```
Run pg_ctl reload through normal operations, then use pg_hba_file_rules and ss -tlnp to verify the effective rules.
```

## Learn the Theory

- [P3 Network Exposure and Firewalls](https://openvapt.com/academy/p3.md)
- [P8 Data Services: Databases, File Shares, DNS and Mail](https://openvapt.com/academy/p8.md)

## References

- [PostgreSQL Client Authentication](https://www.postgresql.org/docs/current/client-authentication.html)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/network/data_services.go

Run it: `openvapt scan --only NET-DB-004`. Read it offline: `openvapt explain NET-DB-004`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/NET-DB-004.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
