CVE-2022-31625: Freeing unallocated memory in php_pgsql_free_params()
Fixed bug : Uninitialized array in pgqueryparams(). (CVE-2022-31625)
Other sources
Freeing unallocated memory in phppgsqlfreeparams()
— Microsoft
In PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7, when using Postgres database extension, supplying invalid parameters to the parametrized query may lead to PHP attempting to free memory using uninitialized data as pointers. This could lead to RCE vulnerability or denial of service.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.0.20 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 7.4.30 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 8.0.20 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 8.1.7 - Upgrade
Upgrade
alpine/php7to a version that resolves this vulnerability.Fixed in 7.4.32-r0 - Upgrade
Upgrade
alpine/php8to a version that resolves this vulnerability.Fixed in 8.0.24-r0 - Upgrade
Upgrade
alpine/php8to a version that resolves this vulnerability.Fixed in 8.0.25-r0 - Upgrade
Upgrade
alpine/php81to a version that resolves this vulnerability.Fixed in 8.1.7-r0 - Upgrade
Upgrade
alpine/php81to a version that resolves this vulnerability.Fixed in 8.1.6-r2 - Upgrade
Upgrade
debian/php7.4to a version that resolves this vulnerability.Fixed in 7.4.30-1+deb11u1 - Upgrade
Upgrade
debian/php7.3to a version that resolves this vulnerability.Fixed in 7.3.31-1~deb10u2 - Upgrade
Upgrade
debian/php8.1to a version that resolves this vulnerability.Fixed in 8.1.7-1 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 7.4.30 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.1.7
Event History
Frequently Asked Questions
What is CVE-2022-31625?
CVE-2022-31625 is a vulnerability in PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7, which can lead to remote code execution or denial of service.
How does CVE-2022-31625 affect PHP?
CVE-2022-31625 affects PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7 when using the Postgres database extension.
What is the severity of CVE-2022-31625?
CVE-2022-31625 has a severity rating of 8.1, which is considered high.
How can CVE-2022-31625 be exploited?
CVE-2022-31625 can be exploited by supplying invalid parameters to a parametrized query in PHP, which may lead to remote code execution or denial of service.
Is there a fix available for CVE-2022-31625?
Yes, the remedy for CVE-2022-31625 is to update PHP to version 7.4.30, 8.0.20, or 8.1.7 depending on the affected version.