{"answers":{"affected":"3 open source packages ship an affected version, including libphp, php and php-min. It affects 2 products.","exploited":"There is no known exploitation of CVE-2022-31625 in the wild and no public exploit code.","fix":"Upgrade libphp to a fixed version for your release line: 7.4.30, 8.0.20 or 8.1.7.","what":"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."},"fix_prompt":"Check this codebase for CVE-2022-31625 and fix it if it is affected.\n\nWhat it is: 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.\nExploitation: There is no known exploitation of CVE-2022-31625 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- libphp (Bitnami): affected from 7.4.0; fixed in 7.4.30, 8.0.20, 8.1.7\n- php (Bitnami): affected from 7.4.0; fixed in 7.4.30, 8.0.20, 8.1.7\n- php-min (Bitnami): affected from 7.4.0; fixed in 7.4.30, 8.0.20, 8.1.7\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-31625/ (Markdown: https://insights.sbomify.com/CVE-2022-31625/index.md)","id":"CVE-2022-31625","markdown":"https://insights.sbomify.com/CVE-2022-31625/index.md","name":"CVE-2022-31625","record":{"aliases":["ALSA-2022:6158","BIT-libphp-2022-31625","BIT-php-2022-31625","BIT-php-min-2022-31625","CLSA-2022-1658171149","CLSA-2022-1658171795","DEBIAN-CVE-2022-31625","ECHO-3ffd-e167-50cd","GHSA-wg63-8xjw-5wvx","RHSA-2022:6158","RLSA-2022:6158","UBUNTU-CVE-2022-31625","USN-5479-3"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP PostgreSQL extension","requires_auth":"none","summary":"Attackers can trigger remote code execution or denial of service in PHP applications using the PostgreSQL extension by supplying invalid query parameters.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"php","cpe":[{"product":"debian_linux","vendor":"debian"},{"product":"php","vendor":"php"}],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-763","name":"Release of Invalid Pointer or Reference"},{"id":"CWE-824","name":"Access of Uninitialized Pointer"},{"id":"CWE-590","name":"Free of Memory not on the Heap"}],"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.","ecosystems":["AlmaLinux:8","Bitnami","Red Hat:enterprise_linux:8::appstream","Rocky Linux:8"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Freeing unallocated memory in php_pgsql_free_params()","id":"CVE-2022-31625","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":"debian:debian_linux","products":["debian:debian_linux","php:php"],"type":"memory_corruption","year":"2022"},"n_packages":126,"n_references":7,"next":{"headline":"mysqlnd/pdo password buffer overflow","id":"CVE-2022-31626"},"packages":[{"ecosystem":"Bitnami","fixed":["7.4.30","8.0.20","8.1.7"],"introduced":["7.4.0","8.0.0","8.1.0"],"last_affected":[],"package":"libphp","purl":"pkg:bitnami/libphp","source":"BIT-libphp-2022-31625"},{"ecosystem":"Bitnami","fixed":["7.4.30","8.0.20","8.1.7"],"introduced":["7.4.0","8.0.0","8.1.0"],"last_affected":[],"package":"php","purl":"pkg:bitnami/php","source":"BIT-php-2022-31625"},{"ecosystem":"Bitnami","fixed":["7.4.30","8.0.20","8.1.7"],"introduced":["7.4.0","8.0.0","8.1.0"],"last_affected":[],"package":"php-min","purl":"pkg:bitnami/php-min","source":"BIT-php-min-2022-31625"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.18-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"apcu-panel","purl":"pkg:rpm/almalinux/apcu-panel","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["1.6.1-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"libzip","purl":"pkg:rpm/almalinux/libzip","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["1.6.1-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"libzip-devel","purl":"pkg:rpm/almalinux/libzip-devel","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["1.6.1-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"libzip-tools","purl":"pkg:rpm/almalinux/libzip-tools","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php","purl":"pkg:rpm/almalinux/php","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-bcmath","purl":"pkg:rpm/almalinux/php-bcmath","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-cli","purl":"pkg:rpm/almalinux/php-cli","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-common","purl":"pkg:rpm/almalinux/php-common","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-dba","purl":"pkg:rpm/almalinux/php-dba","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-dbg","purl":"pkg:rpm/almalinux/php-dbg","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-devel","purl":"pkg:rpm/almalinux/php-devel","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-embedded","purl":"pkg:rpm/almalinux/php-embedded","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-enchant","purl":"pkg:rpm/almalinux/php-enchant","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-ffi","purl":"pkg:rpm/almalinux/php-ffi","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-fpm","purl":"pkg:rpm/almalinux/php-fpm","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-gd","purl":"pkg:rpm/almalinux/php-gd","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-gmp","purl":"pkg:rpm/almalinux/php-gmp","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-intl","purl":"pkg:rpm/almalinux/php-intl","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-json","purl":"pkg:rpm/almalinux/php-json","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-ldap","purl":"pkg:rpm/almalinux/php-ldap","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-mbstring","purl":"pkg:rpm/almalinux/php-mbstring","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-mysqlnd","purl":"pkg:rpm/almalinux/php-mysqlnd","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-odbc","purl":"pkg:rpm/almalinux/php-odbc","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-opcache","purl":"pkg:rpm/almalinux/php-opcache","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-pdo","purl":"pkg:rpm/almalinux/php-pdo","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["1:1.10.12-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pear","purl":"pkg:rpm/almalinux/php-pear","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.18-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pecl-apcu","purl":"pkg:rpm/almalinux/php-pecl-apcu","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.18-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pecl-apcu-devel","purl":"pkg:rpm/almalinux/php-pecl-apcu-devel","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["2.0.1-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pecl-rrd","purl":"pkg:rpm/almalinux/php-pecl-rrd","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["2.9.5-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pecl-xdebug","purl":"pkg:rpm/almalinux/php-pecl-xdebug","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["1.18.2-1.module_el8.6.0+2750+78feabcb"],"introduced":["0"],"last_affected":[],"package":"php-pecl-zip","purl":"pkg:rpm/almalinux/php-pecl-zip","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-pgsql","purl":"pkg:rpm/almalinux/php-pgsql","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-process","purl":"pkg:rpm/almalinux/php-process","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-snmp","purl":"pkg:rpm/almalinux/php-snmp","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-soap","purl":"pkg:rpm/almalinux/php-soap","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-xml","purl":"pkg:rpm/almalinux/php-xml","source":"ALSA-2022:6158"},{"ecosystem":"AlmaLinux:8","fixed":["7.4.19-4.module_el8.6.0+3238+624bf8b8"],"introduced":["0"],"last_affected":[],"package":"php-xmlrpc","purl":"pkg:rpm/almalinux/php-xmlrpc","source":"ALSA-2022:6158"}],"prev":{"headline":"Denial of service in n/a","id":"CVE-2022-31624"},"products":["PHP"],"published":"2022-06-16","related":[{"cvss_score":10,"headline":"ProFTPD Improper Access Control","id":"CVE-2015-3306","kev_date_added":"2026-10-08","published":"2015-05-18"},{"cvss_score":9.9,"headline":"RoundCube Webmail Deserialization of Untrusted Data","id":"CVE-2025-49113","kev_date_added":"2026-02-20","published":"2025-06-02"},{"cvss_score":9.8,"headline":"GNU InetUtils Argument Injection","id":"CVE-2026-24061","kev_date_added":"2026-01-26","published":"2026-01-21"},{"cvss_score":9.8,"headline":"Linux Kernel Improper Check for Unusual or Exceptional Conditions","id":"CVE-2025-39682","kev_date_added":"2026-09-18","published":"2025-09-05"},{"cvss_score":9.8,"headline":"Mozilla Firefox Use-After-Free","id":"CVE-2024-9680","kev_date_added":"2024-10-15","published":"2024-10-09"},{"cvss_score":9.8,"headline":"RARLAB UnRAR Directory Traversal","id":"CVE-2022-30333","kev_date_added":"2022-08-09","published":"2022-05-09"},{"cvss_score":9.8,"headline":"Roundcube Webmail SQL Injection","id":"CVE-2021-44026","kev_date_added":"2023-06-22","published":"2021-11-19"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-09-16","vendors":["PHP Group"]},"summary":"Attackers can trigger remote code execution or denial of service in PHP applications using the PostgreSQL extension by supplying invalid query parameters.","url":"https://insights.sbomify.com/CVE-2022-31625/"}