CVE-2022-25852: Uncontrolled Resource Consumption in pg-native and libpq
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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
Minimum fixed version
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 →
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.
You can find more information about this vulnerability in the GitHub Advisory Database advisory for GHSA-j32j-2hxv-rqf7 (https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/06/GHSA-j32j-2hxv-rqf7/GHSA-j32j-2hxv-rqf7.json).
References
Related vulnerabilities
Recent vulnerabilities recorded for libpq.