CVE-2022-31625 Freeing unallocated memory in php_pgsql_free_params()
Attackers can trigger remote code execution or denial of service in PHP applications using the PostgreSQL extension by supplying invalid query parameters.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-31625?
CVE-2022-31625 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 16 Jun 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Which versions are affected by CVE-2022-31625?
3 open source packages ship an affected version, including libphp, php and php-min. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
libphp Bitnami | From 7.4.0 | 7.4.30, 8.0.20, 8.1.7 |
php Bitnami | From 7.4.0 | 7.4.30, 8.0.20, 8.1.7 |
php-min Bitnami | From 7.4.0 | 7.4.30, 8.0.20, 8.1.7 |
Linux distribution packages (37)
apcu-panel AlmaLinux:8 | All versions | 5.1.18-1.module_el8.6.0+2750+78feabcb |
libzip AlmaLinux:8 | All versions | 1.6.1-1.module_el8.6.0+2750+78feabcb |
libzip-devel AlmaLinux:8 | All versions | 1.6.1-1.module_el8.6.0+2750+78feabcb |
libzip-tools AlmaLinux:8 | All versions | 1.6.1-1.module_el8.6.0+2750+78feabcb |
php AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-bcmath AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-cli AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-common AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-dba AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-dbg AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-devel AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-embedded AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-enchant AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-ffi AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-fpm AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-gd AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-gmp AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-intl AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-json AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-ldap AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-mbstring AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-mysqlnd AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-odbc AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-opcache AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-pdo AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-pear AlmaLinux:8 | All versions | 1:1.10.12-1.module_el8.6.0+2750+78feabcb |
php-pecl-apcu AlmaLinux:8 | All versions | 5.1.18-1.module_el8.6.0+2750+78feabcb |
php-pecl-apcu-devel AlmaLinux:8 | All versions | 5.1.18-1.module_el8.6.0+2750+78feabcb |
php-pecl-rrd AlmaLinux:8 | All versions | 2.0.1-1.module_el8.6.0+2750+78feabcb |
php-pecl-xdebug AlmaLinux:8 | All versions | 2.9.5-1.module_el8.6.0+2750+78feabcb |
php-pecl-zip AlmaLinux:8 | All versions | 1.18.2-1.module_el8.6.0+2750+78feabcb |
php-pgsql AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-process AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-snmp AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-soap AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-xml AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
php-xmlrpc AlmaLinux:8 | All versions | 7.4.19-4.module_el8.6.0+3238+624bf8b8 |
Products include Debian Debian Linux, Php Php.
How do I fix CVE-2022-31625?
Upgrade libphp to a fixed version for your release line: 7.4.30, 8.0.20 or 8.1.7.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2022-31625 being exploited?
There is no known exploitation of CVE-2022-31625 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as ALSA-2022:6158, BIT-libphp-2022-31625, BIT-php-2022-31625, BIT-php-min-2022-31625, CLSA-2022-1658171149, CLSA-2022-1658171795 and 7 more.