CVE-2021-23214
PostgreSQL vulnerability analysis and mitigation

Overview

CVE-2021-23214 is a security vulnerability discovered in PostgreSQL that affects multiple versions of the database management system. When the server is configured to use trust authentication with a clientcert requirement or to use cert authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first established, despite the use of SSL certificate verification and encryption. The vulnerability was disclosed on November 11, 2021, affecting PostgreSQL versions 9.6 through 14 (PostgreSQL Security).

Technical details

The vulnerability occurs when the server collects data from the client socket during the initial connection. When SSL or GSS encryption is requested during startup, any additional data received with the initial request message remained in the buffer and would be treated as already-decrypted data once the encryption handshake completed. This allowed a man-in-the-middle attacker to inject cleartext data into the start of an encryption-protected database session. The CVSS 3.0 score for this vulnerability is 8.1 (High), with a vector of AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (PostgreSQL Security).

Impact

The vulnerability could allow attackers to send faked SQL commands to the server, particularly effective against servers relying on SSL certificate authentication. This could potentially lead to unauthorized data access, manipulation, or other malicious activities in the database system (CVE Mitre).

Mitigation and workarounds

The vulnerability has been fixed in PostgreSQL versions 14.1, 13.5, 12.9, 11.14, 10.19, and 9.6.24. The fix implements a protocol-violation error if the internal buffer is not empty after the encryption handshake. Organizations are strongly advised to upgrade to these patched versions (PostgreSQL Security).

Additional resources


SourceThis report was generated using AI

Related PostgreSQL vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-8715HIGH8.8
  • PostgreSQLPostgreSQL
  • postgresql17-private-libs
NoYesAug 14, 2025
CVE-2025-8714HIGH8.8
  • PostgreSQLPostgreSQL
  • postgresql:13::postgresql-test
NoYesAug 14, 2025
CVE-2025-12818MEDIUM5.9
  • PostgreSQLPostgreSQL
  • postgresql15-docs
NoYesNov 13, 2025
CVE-2025-12817LOW3.1
  • PostgreSQLPostgreSQL
  • postgresql:12::postgresql-private-devel
NoYesNov 13, 2025
CVE-2025-8713LOW3.1
  • PostgreSQLPostgreSQL
  • postgresql14-devel
NoYesAug 14, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management