---
title: "NET-DB-019 PostgreSQL Uses md5 or password Authentication"
canonical: https://openvapt.com/checks/NET-DB-019.html
html: https://openvapt.com/checks/NET-DB-019.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-019 PostgreSQL Uses md5 or password Authentication

pg_hba.conf has active rules with the md5 or password method instead of scram-sha-256.

- Domain: Network
- Severity: Medium
- Control category: Identity and Authentication
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- CIS Controls v8: 5.2
- NIST CSF 2.0: PR.AA-01
- CWE: CWE-328, CWE-916
- OWASP Top 10 2021: A02:2021, A07:2021
- OWASP ASVS 4.0.3: 2.4.1
- NIST SP 800-53 Rev. 5: IA-5, IA-5(1), SC-13
- Benchmark topic: Database password hashing and authentication method (topic only, no benchmark text)

## Why It Matters

The password method sends the password in clear text unless the connection is encrypted; md5 is a fast unsalted construction whose stored hashes work as passwords themselves (pass-the-hash) and which the PostgreSQL documentation describes as obsolete. SCRAM-SHA-256 fixes both.

## How It Detects

Reads pg_hba.conf, ignores comments, and flags every rule whose method is md5 or password. NET-DB-004 already covers trust and open address ranges.

## How to Fix

Set  password_encryption = scram-sha-256  in postgresql.conf, have every role reset its password so a SCRAM verifier is stored, then change the pg_hba.conf methods to scram-sha-256 and reload.

## How to Verify

```
SELECT * FROM pg_hba_file_rules WHERE auth_method IN ('md5','password');  should return no rows.
```

## 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)
- [P19 Database, Mail and DNS Hardening](https://openvapt.com/academy/p19.md)

## References

- [PostgreSQL, Authentication Methods](https://www.postgresql.org/docs/current/auth-methods.html)
- [PostgreSQL, Password Authentication](https://www.postgresql.org/docs/current/auth-password.html)
- [NIST SP 800-63B, Digital Identity Guidelines: Authentication](https://pages.nist.gov/800-63-3/sp800-63b.html)

## Source Code

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

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

---

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-019.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
