Use of Inherently Dangerous Function Affecting libpq package, versions [14.2,]


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-CONAN-LIBPQ-16691381
  • published14 May 2026
  • disclosed14 May 2026
  • creditYu Kunpeng, Martin Heistermann

Introduced: 14 May 2026

NewCVE-2026-6477  (opens in a new tab)
CWE-242  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

Affected versions of this package are vulnerable to Use of Inherently Dangerous Function via the PQfn function when called with result_is_int=0 in the lo_export, lo_read, lo_lseek64, and lo_tell64 functions. An attacker can overwrite client stack memory with arbitrary data by sending a specially crafted, large response from the server superuser. This can lead to compromise of client applications such as psql or pg_dump when they interact with a malicious server superuser.

Workaround

This vulnerability can be mitigated by using PQexecPrepared() instead of PQfn(..., result_is_int=0, ...) or its lo_* wrappers.

CVSS Base Scores

version 4.0
version 3.1