{"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-31626 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-31626 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 16 Jun 2022. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-31626 and fix it if it is affected.\n\nWhat it is: CVE-2022-31626 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 16 Jun 2022. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-31626 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-31626/ (Markdown: https://insights.sbomify.com/CVE-2022-31626/index.md)","id":"CVE-2022-31626","markdown":"https://insights.sbomify.com/CVE-2022-31626/index.md","name":"CVE-2022-31626","record":{"aliases":["ALSA-2022:5468","ALSA-2022:5904","BIT-libphp-2022-31626","BIT-php-2022-31626","BIT-php-min-2022-31626","DEBIAN-CVE-2022-31626","ECHO-615f-247f-a22b","GHSA-jfc6-9gw3-fhfg","RHSA-2022:5467","RHSA-2022:5468","RHSA-2022:5471","RHSA-2022:5904","RLSA-2022:5467","RLSA-2022:5468","RLSA-2022:5904","UBUNTU-CVE-2022-31626"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"PHP mysqlnd driver","requires_auth":"low_privilege","summary":"A buffer overflow in PHP's mysqlnd driver allows remote code execution if an attacker controls the connection host and password length.","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":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-120","name":"Buffer Copy without Checking Size of Input"}],"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 pdo_mysql extension with mysqlnd driver, if the third party is allowed to supply host to connect to and the password for the connection, password of excessive length can trigger a buffer overflow in PHP, which can lead to a remote code execution vulnerability.","ecosystems":["AlmaLinux:8","AlmaLinux:9","Bitnami","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Red Hat:rhel_eus:8.4::appstream","Rocky Linux:8","Rocky Linux:9"],"exploits":{"exploitdb":0,"first_seen":"2022-12-06","github_poc":2,"max_poc_stars":6,"metasploit":0,"nuclei":0,"refs":[{"date":"2022-12-06T16:19:03Z","kind":"github_poc","ref":"https://github.com/amitlttwo/CVE-2022-31626","stars":6,"title":null},{"date":"2026-08-06T06:39:46Z","kind":"github_poc","ref":"https://github.com/HORKimhab/CVE-2022-31626-CVE-2024-2961-CVE-2019-6977","stars":0,"title":"CVE-2022-31626, CVE-2024-2961, CVE-2019-6977, PHP security research"}],"tier":"poc_unverified"},"has_fix":true,"headline":"mysqlnd/pdo password buffer overflow","id":"CVE-2022-31626","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":329,"n_references":7,"next":{"headline":"Heap buffer overflow in finfo_buffer","id":"CVE-2022-31627"},"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-31626"},{"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-31626"},{"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-31626"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.20-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"apcu-panel","purl":"pkg:rpm/almalinux/apcu-panel","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["1.7.3-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"libzip","purl":"pkg:rpm/almalinux/libzip","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["1.7.3-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"libzip-devel","purl":"pkg:rpm/almalinux/libzip-devel","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["1.7.3-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"libzip-tools","purl":"pkg:rpm/almalinux/libzip-tools","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["1:1.10.13-1.module_el8.6.0+3268+b150a051"],"introduced":["0"],"last_affected":[],"package":"php-pear","purl":"pkg:rpm/almalinux/php-pear","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.20-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"php-pecl-apcu","purl":"pkg:rpm/almalinux/php-pecl-apcu","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["5.1.20-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"php-pecl-apcu-devel","purl":"pkg:rpm/almalinux/php-pecl-apcu-devel","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["2.0.3-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"php-pecl-rrd","purl":"pkg:rpm/almalinux/php-pecl-rrd","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["3.1.2-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"php-pecl-xdebug3","purl":"pkg:rpm/almalinux/php-pecl-xdebug3","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:8","fixed":["1.19.2-1.module_el8.6.0+2739+efabdb8f"],"introduced":["0"],"last_affected":[],"package":"php-pecl-zip","purl":"pkg:rpm/almalinux/php-pecl-zip","source":"ALSA-2022:5468"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php","purl":"pkg:rpm/almalinux/php","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-bcmath","purl":"pkg:rpm/almalinux/php-bcmath","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-cli","purl":"pkg:rpm/almalinux/php-cli","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-common","purl":"pkg:rpm/almalinux/php-common","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-dba","purl":"pkg:rpm/almalinux/php-dba","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-dbg","purl":"pkg:rpm/almalinux/php-dbg","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-devel","purl":"pkg:rpm/almalinux/php-devel","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-embedded","purl":"pkg:rpm/almalinux/php-embedded","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-enchant","purl":"pkg:rpm/almalinux/php-enchant","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-ffi","purl":"pkg:rpm/almalinux/php-ffi","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-fpm","purl":"pkg:rpm/almalinux/php-fpm","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-gd","purl":"pkg:rpm/almalinux/php-gd","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-gmp","purl":"pkg:rpm/almalinux/php-gmp","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-intl","purl":"pkg:rpm/almalinux/php-intl","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-ldap","purl":"pkg:rpm/almalinux/php-ldap","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-mbstring","purl":"pkg:rpm/almalinux/php-mbstring","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-mysqlnd","purl":"pkg:rpm/almalinux/php-mysqlnd","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-odbc","purl":"pkg:rpm/almalinux/php-odbc","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-opcache","purl":"pkg:rpm/almalinux/php-opcache","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-pdo","purl":"pkg:rpm/almalinux/php-pdo","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-pgsql","purl":"pkg:rpm/almalinux/php-pgsql","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-process","purl":"pkg:rpm/almalinux/php-process","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-snmp","purl":"pkg:rpm/almalinux/php-snmp","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-soap","purl":"pkg:rpm/almalinux/php-soap","source":"ALSA-2022:5904"},{"ecosystem":"AlmaLinux:9","fixed":["8.0.13-2.el9_0"],"introduced":["0"],"last_affected":[],"package":"php-xml","purl":"pkg:rpm/almalinux/php-xml","source":"ALSA-2022:5904"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:5.1.18-1.module+el8.3.0+6678+b09f589e"],"introduced":["0"],"last_affected":[],"package":"apcu-panel","purl":"pkg:rpm/redhat/apcu-panel","source":"RHSA-2022:5467"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:5.1.20-1.module+el8.6.0+13671+84712317"],"introduced":["0"],"last_affected":[],"package":"apcu-panel","purl":"pkg:rpm/redhat/apcu-panel","source":"RHSA-2022:5468"}],"prev":{"headline":"Freeing unallocated memory in php_pgsql_free_params()","id":"CVE-2022-31625"},"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":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"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)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-09-17","vendors":["PHP Group"]},"summary":"A buffer overflow in PHP's mysqlnd driver allows remote code execution if an attacker controls the connection host and password length.","url":"https://insights.sbomify.com/CVE-2022-31626/"}