CVE-2023-31136

CVE-2023-31136 is a low-severity security vulnerability in github.com/vapor/postgres-nio (swift), affecting versions < 1.14.2. It is fixed in 1.14.2.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

PostgresNIO processes unencrypted bytes from man-in-the-middle

Workarounds

There are no known workarounds for unpatched users.

Additional Credits

Special thanks to PostgreSQL's Tom Lane <[email protected]> for reporting this issue!

References

Impact

Any user of PostgresNIO 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 remaining text in this section is quoted verbatim from PostgreSQL's CVE-2021-23222 advisory:

If more preconditions hold, the attacker can exfiltrate the client's password or other confidential data that might be transmitted early in a session. The attacker must have a way to trick the client's intended server into making the confidential data accessible to the attacker. A known implementation having that property is a PostgreSQL configuration vulnerable to CVE-2021-23214. As with any exploitation of CVE-2021-23214, the server must be using trust authentication with a clientcert requirement or using cert authentication. To disclose a password, the client must be in possession of a password, which is atypical when using an authentication configuration vulnerable to CVE-2021-23214. The attacker must have some other way to access the server to retrieve the exfiltrated data (a valid, unprivileged login account would be sufficient).

CVE-2023-31136 has a CVSS score of 3.7 (Low). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.14.2); upgrading removes the vulnerable code path.

Affected versions

github.com/vapor/postgres-nio (< 1.14.2)

Security releases

github.com/vapor/postgres-nio → 1.14.2 (swift)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

The vulnerability is addressed in PostgresNIO versions starting from 1.14.2 via 2df54bc94607f44584ae6ffa74e3cd754fffafc7, which required additional support from SwiftNIO.

Frequently Asked Questions

  1. What is CVE-2023-31136? CVE-2023-31136 is a low-severity security vulnerability in github.com/vapor/postgres-nio (swift), affecting versions < 1.14.2. It is fixed in 1.14.2.
  2. How severe is CVE-2023-31136? CVE-2023-31136 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/vapor/postgres-nio are affected by CVE-2023-31136? github.com/vapor/postgres-nio (swift) versions < 1.14.2 is affected.
  4. Is there a fix for CVE-2023-31136? Yes. CVE-2023-31136 is fixed in 1.14.2. Upgrade to this version or later.
  5. Is CVE-2023-31136 exploitable, and should I be worried? Whether CVE-2023-31136 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2023-31136 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2023-31136? Upgrade github.com/vapor/postgres-nio to 1.14.2 or later.

Stop the waste.
Protect your environment with Kodem.