CVE-2022-25852: Uncontrolled Resource Consumption in pg-native and libpq

libpq Updated 02 Oct 2025

Summary

18/06/2022
Yes i
High
7.5

CVE-2022-25852: pg-native and libpq vulnerable to uncontrolled resource consumption. Affects libpq versions < 1.8.10. Fixed in 1.8.10. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The pg-native package is a binding to npm's libpq library, which in turn has the addons and bindings to the actual C libpq library. It provides a native interface for Node.js applications to interact with PostgreSQL databases. The libpq package is also an npm package that provides a pure JavaScript implementation of the PostgreSQL protocol. Both packages are widely used in Node.js applications for database connectivity and query execution.

Vulnerability Detail

The vulnerability (CVE-2022-25852) affects all versions of the pg-native and libpq packages. It is a Denial of Service (DoS) vulnerability that occurs when the addons in pg-native and libpq attempt to cast the second argument to an array and fail. This failure happens for every non-array argument passed, leading to uncontrolled resource consumption. An attacker can exploit this vulnerability by sending specially crafted requests to the affected application, causing it to consume excessive resources and potentially resulting in service disruption. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

How To Fix

Latest published version: 1.11.0 as of 23 Oct 2026

npm install libpq@1.11.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.8.10

This is the first release that contains the fix.

npm install libpq@1.8.10

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update the packages to the fixed versions mentioned above.

Conclusion

The vulnerability (CVE-2022-25852) affects the pg-native and libpq packages, allowing for a Denial of Service (DoS) attack. To mitigate the vulnerability, it is crucial to update the packages to their fixed versions. No known workarounds are available. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libpq →

Share this vulnerability

FAQ

The vulnerability can be exploited by an attacker to cause a Denial of Service (DoS) condition in the affected application, leading to service disruption.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the playground will analyze it for vulnerabilities in real-time.

There are no known public exploits for this vulnerability at the time of this advisory.

Yes, the CVSS score for this vulnerability is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for libpq.

How To Fix

Latest published version: 1.11.0 as of 23 Oct 2026

npm install libpq@1.11.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.8.10

This is the first release that contains the fix.

npm install libpq@1.8.10

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback