CVEfocus › CVE database › CVE-2022-31625

CVE-2022-31625Freeing unallocated memory in php_pgsql_free_params()

CVSS 8.1 HighEPSS 2.8% (higher than 87% of CVEs)Published 2022-06-16Updated 2024-09-16Assigner: php

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.

CWE-590CWE-824

What to do

Fixed builds are available from AlmaLinux, Alpine, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

147Fixed
2Fix pending
52Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04php8.1Fixed8.1.2-1ubuntu2.1UBUNTU-CVE-2022-31625
Ubuntu 20.04php7.4Fixed7.4.3-4ubuntu2.12UBUNTU-CVE-2022-31625
Ubuntu 18.04php7.2Fixed7.2.24-0ubuntu0.18.04.12UBUNTU-CVE-2022-31625
Ubuntu 16.04php7.0Fix pending7.0.33-0ubuntu0.16.04.16+esm4 (Ubuntu Pro)UBUNTU-CVE-2022-31625
Ubuntu 14.04php5Fix pendingUBUNTU-CVE-2022-31625
Red Hat Enterprise Linux 9phpFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-bcmathFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-cliFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-commonFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-dbaFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-dbgFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-develFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-embeddedFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-enchantFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-ffiFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-fpmFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-gdFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-gmpFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-intlFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-ldapFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-mbstringFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-mysqlndFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-odbcFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-opcacheFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-pdoFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-pgsqlFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-processFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-snmpFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-soapFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 9php-xmlFixed0:8.0.20-3.el9RHSA-2022:8197
Red Hat Enterprise Linux 8apcu-panelFixed0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:7624
Red Hat Enterprise Linux 8libzipFixed0:1.7.3-1.module+el8.6.0+13671+84712317RHSA-2022:6158
Red Hat Enterprise Linux 8libzip-develFixed0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7624
Red Hat Enterprise Linux 8libzip-toolsFixed0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7624
Red Hat Enterprise Linux 8phpFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-bcmathFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-cliFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-commonFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-dbaFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-dbgFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-develFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-embeddedFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-enchantFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-ffiFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-fpmFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-gdFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-gmpFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-intlFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-jsonFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:6158
Red Hat Enterprise Linux 8php-ldapFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-mbstringFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-mysqlndFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-odbcFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-opcacheFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-pdoFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-pearFixed1:1.10.13-1.module+el8.6.0+13671+84712317RHSA-2022:6158
Red Hat Enterprise Linux 8php-pecl-apcuFixed0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:7624
Red Hat Enterprise Linux 8php-pecl-apcu-develFixed0:5.1.20-1.module+el8.6.0+13671+84712317RHSA-2022:6158
Red Hat Enterprise Linux 8php-pecl-rrdFixed0:2.0.3-1.module+el8.6.0+13671+84712317RHSA-2022:6158
Red Hat Enterprise Linux 8php-pecl-xdebugFixed0:2.9.5-1.module+el8.3.0+6678+b09f589eRHSA-2022:6158
Red Hat Enterprise Linux 8php-pecl-xdebug3Fixed0:3.1.2-1.module+el8.6.0+13671+84712317RHSA-2022:7624
Red Hat Enterprise Linux 8php-pecl-zipFixed0:1.18.2-1.module+el8.3.0+6678+b09f589eRHSA-2022:7624
Red Hat Enterprise Linux 8php-pgsqlFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-processFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-snmpFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:7624
Red Hat Enterprise Linux 8php-soapFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-xmlFixed0:8.0.20-2.module+el8.7.0+16187+bb5ab920RHSA-2022:6158
Red Hat Enterprise Linux 8php-xmlrpcFixed0:7.4.19-4.module+el8.6.0+16316+906f6c6dRHSA-2022:6158
Red Hat Enterprise Linux 7phpNot affected
Red Hat Enterprise Linux 7php-bcmathNot affected
Red Hat Enterprise Linux 7php-cliNot affected
Red Hat Enterprise Linux 7php-commonNot affected
Red Hat Enterprise Linux 7php-dbaNot affected
Red Hat Enterprise Linux 7php-develNot affected
Red Hat Enterprise Linux 7php-embeddedNot affected
Red Hat Enterprise Linux 7php-enchantNot affected
Red Hat Enterprise Linux 7php-fpmNot affected
Red Hat Enterprise Linux 7php-gdNot affected
Red Hat Enterprise Linux 7php-intlNot affected
Red Hat Enterprise Linux 7php-ldapNot affected
Red Hat Enterprise Linux 7php-mbstringNot affected
Red Hat Enterprise Linux 7php-mysqlNot affected
Red Hat Enterprise Linux 7php-mysqlndNot affected
Red Hat Enterprise Linux 7php-odbcNot affected
Red Hat Enterprise Linux 7php-pdoNot affected
Red Hat Enterprise Linux 7php-pgsqlNot affected
Red Hat Enterprise Linux 7php-processNot affected
Red Hat Enterprise Linux 7php-pspellNot affected
Red Hat Enterprise Linux 7php-recodeNot affected
Red Hat Enterprise Linux 7php-snmpNot affected
Red Hat Enterprise Linux 7php-soapNot affected
Red Hat Enterprise Linux 7php-xmlNot affected
Red Hat Enterprise Linux 7php-xmlrpcNot affected
Red Hat Enterprise Linux 6phpNot affected
Red Hat Enterprise Linux 6php-bcmathNot affected
Red Hat Enterprise Linux 6php-cliNot affected
Red Hat Enterprise Linux 6php-commonNot affected
Red Hat Enterprise Linux 6php-dbaNot affected
Red Hat Enterprise Linux 6php-develNot affected
Red Hat Enterprise Linux 6php-embeddedNot affected
Red Hat Enterprise Linux 6php-enchantNot affected
Red Hat Enterprise Linux 6php-fpmNot affected
Red Hat Enterprise Linux 6php-gdNot affected
Red Hat Enterprise Linux 6php-imapNot affected
Red Hat Enterprise Linux 6php-intlNot affected
Red Hat Enterprise Linux 6php-ldapNot affected
Red Hat Enterprise Linux 6php-mbstringNot affected
Red Hat Enterprise Linux 6php-mysqlNot affected
Red Hat Enterprise Linux 6php-odbcNot affected
Red Hat Enterprise Linux 6php-pdoNot affected
Red Hat Enterprise Linux 6php-pgsqlNot affected
Red Hat Enterprise Linux 6php-processNot affected
Red Hat Enterprise Linux 6php-pspellNot affected
Red Hat Enterprise Linux 6php-recodeNot affected
Red Hat Enterprise Linux 6php-snmpNot affected
Red Hat Enterprise Linux 6php-soapNot affected
Red Hat Enterprise Linux 6php-tidyNot affected
Red Hat Enterprise Linux 6php-xmlNot affected
Red Hat Enterprise Linux 6php-xmlrpcNot affected
Red Hat Enterprise Linux 6php-ztsNot affected
AlmaLinux 9phpFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-bcmathFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-cliFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-commonFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-dbaFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-dbgFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-develFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-embeddedFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-enchantFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-ffiFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-fpmFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-gdFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-gmpFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-intlFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-ldapFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-mbstringFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-mysqlndFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-odbcFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-opcacheFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-pdoFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-pgsqlFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-processFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-snmpFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-soapFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 9php-xmlFixed8.0.20-3.el9ALSA-2022:8197
AlmaLinux 8apcu-panelFixed5.1.20-1.module_el8.6.0+2739+efabdb8fALSA-2022:6158
AlmaLinux 8libzipFixed1.7.3-1.module_el8.6.0+2739+efabdb8fALSA-2022:7624
AlmaLinux 8libzip-develFixed1.7.3-1.module_el8.6.0+2739+efabdb8fALSA-2022:6158
AlmaLinux 8libzip-toolsFixed1.6.1-1.module_el8.6.0+2750+78feabcbALSA-2022:7624
AlmaLinux 8phpFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-bcmathFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-cliFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-commonFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-dbaFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-dbgFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-develFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-embeddedFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-enchantFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-ffiFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-fpmFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-gdFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-gmpFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-intlFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-jsonFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:6158
AlmaLinux 8php-ldapFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-mbstringFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-mysqlndFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-odbcFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-opcacheFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-pdoFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-pearFixed1:1.10.13-1.module_el8.6.0+3061+6878dd1bALSA-2022:7624
AlmaLinux 8php-pecl-apcuFixed5.1.18-1.module_el8.6.0+2750+78feabcbALSA-2022:7624
AlmaLinux 8php-pecl-apcu-develFixed5.1.20-1.module_el8.6.0+3061+6878dd1bALSA-2022:6158
AlmaLinux 8php-pecl-rrdFixed2.0.1-1.module_el8.6.0+2750+78feabcbALSA-2022:7624
AlmaLinux 8php-pecl-xdebugFixed2.9.5-1.module_el8.6.0+2750+78feabcbALSA-2022:6158
AlmaLinux 8php-pecl-xdebug3Fixed3.1.2-1.module_el8.6.0+3061+6878dd1bALSA-2022:7624
AlmaLinux 8php-pecl-zipFixed1.18.2-1.module_el8.6.0+2750+78feabcbALSA-2022:7624
AlmaLinux 8php-pgsqlFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-processFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-snmpFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-soapFixed8.0.20-2.module_el8.7.0+3286+6cee236eALSA-2022:6158
AlmaLinux 8php-xmlFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:7624
AlmaLinux 8php-xmlrpcFixed7.4.19-4.module_el8.6.0+3238+624bf8b8ALSA-2022:6158
Rocky Linux 9phpFixed0:8.0.20-3.el9RLSA-2022:8197
Rocky Linux 8libzipFixed0:1.6.1-1.module+el8.4.0+415+e936cba3RLSA-2022:7624
Rocky Linux 8phpFixed0:7.4.19-4.module+el8.6.0+1006+0d5a469fRLSA-2022:7624
Rocky Linux 8php-pearFixed1:1.10.13-1.module+el8.7.0+1067+0a7071ccRLSA-2022:6158
Rocky Linux 8php-pecl-apcuFixed0:5.1.18-1.module+el8.6.0+789+2130c178RLSA-2022:6158
Rocky Linux 8php-pecl-rrdFixed0:2.0.3-1.module+el8.6.0+790+fc63e43fRLSA-2022:6158
Rocky Linux 8php-pecl-xdebugFixed0:2.9.5-1.module+el8.4.0+415+e936cba3RLSA-2022:6158
Rocky Linux 8php-pecl-xdebug3Fixed0:3.1.2-1.module+el8.6.0+790+fc63e43fRLSA-2022:7624
Rocky Linux 8php-pecl-zipFixed0:1.19.2-1.module+el8.6.0+790+fc63e43fRLSA-2022:6158
Alpine Linux 3.19php81Fixed8.1.6-r2ALPINE-CVE-2022-31625
Alpine Linux 3.18php81Fixed8.1.6-r2ALPINE-CVE-2022-31625
Alpine Linux 3.17php81Fixed8.1.6-r2ALPINE-CVE-2022-31625
Alpine Linux 3.16php8Fixed8.0.24-r0ALPINE-CVE-2022-31625
Alpine Linux 3.16php81Fixed8.1.7-r0ALPINE-CVE-2022-31625
Alpine Linux 3.15php7Fixed7.4.32-r0ALPINE-CVE-2022-31625
Alpine Linux 3.15php8Fixed8.0.25-r0ALPINE-CVE-2022-31625
Alpine Linux 3.14php7Fixed7.4.32-r0ALPINE-CVE-2022-31625
Alpine Linux 3.14php8Fixed8.0.24-r0ALPINE-CVE-2022-31625

What the vendor says

As published in the CVE record by php, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.