cve.bz

CVE-2022-31626 Classic Buffer Overflow

8.8 highExploit referenceEPSS 58%Fix available

High (8.8). EPSS 58% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
58% (unchanged from 58% a week ago; 58% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-120 Buffer Copy without Checking Size of Input (Classic Buffer Overflow)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-31626 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-31626?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-31626?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-31626 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
PHP Group PHPfrom 7.4.X before 7.4.30
PHP Group PHPfrom 8.0.X before 8.0.20
PHP Group PHPfrom 8.1.X before 8.1.7

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10php7.37.3.31-1~deb10u2DLA-3243-1
Debian11php7.47.4.30-1+deb11u1DEBIAN-CVE-2022-31626 DSA-5179-1
Ubuntu18.04:LTSphp7.27.2.24-0ubuntu0.18.04.12UBUNTU-CVE-2022-31626 USN-5479-1
Ubuntu20.04:LTSphp7.47.4.3-4ubuntu2.12UBUNTU-CVE-2022-31626 USN-5479-1
Ubuntu22.04:LTSphp8.18.1.2-1ubuntu2.1UBUNTU-CVE-2022-31626 USN-5479-1
UbuntuPro:14.04:LTSphp5no fix listedUBUNTU-CVE-2022-31626
UbuntuPro:16.04:LTSphp7.07.0.33-0ubuntu0.16.04.16+esm4UBUNTU-CVE-2022-31626 USN-5479-2
Red Hatenterprise_linux:8::appstreamapcu-panel, php-pecl-apcu, php-pecl-apcu-devel and 2 more0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:5467
Red Hatenterprise_linux:8::appstreamapcu-panel, php-pecl-apcu, php-pecl-apcu-devel and 2 more0:5.1.20-1.module+el8.6.0+13671+84712317RHSA-2022:5468
Red Hatenterprise_linux:8::appstreamlibzip, libzip-devel, libzip-tools and 3 more0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:5467
Red Hatenterprise_linux:8::appstreamlibzip, libzip-devel, libzip-tools and 3 more0:1.7.3-1.module+el8.6.0+13671+84712317RHSA-2022:5468
Red Hatenterprise_linux:8::appstreamphp, php-gd, php-cli and 51 more0:7.4.19-3.module+el8.6.0+15726+994cde98RHSA-2022:5467
Red Hatenterprise_linux:8::appstreamphp, php-gd, php-cli and 47 more0:8.0.13-3.module+el8.6.0+15725+0c79e7c4RHSA-2022:5468
Red Hatenterprise_linux:8::appstreamphp-pear1:1.10.12-1.module+el8.3.0+6678+b09f589eRHSA-2022:5467
Red Hatenterprise_linux:8::appstreamphp-pear1:1.10.13-1.module+el8.6.0+13671+84712317RHSA-2022:5468
Red Hatenterprise_linux:8::appstreamphp-pecl-rrd, php-pecl-rrd-debuginfo, php-pecl-rrd-debugsource0:2.0.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:5467
Red Hatenterprise_linux:8::appstreamphp-pecl-rrd, php-pecl-rrd-debuginfo, php-pecl-rrd-debugsource0:2.0.3-1.module+el8.6.0+13671+84712317RHSA-2022:5468
Red Hatenterprise_linux:8::appstreamphp-pecl-xdebug, php-pecl-xdebug-debuginfo, php-pecl-xdebug-debugsource0:2.9.5-1.module+el8.3.0+6678+b09f589eRHSA-2022:5467
Red Hatenterprise_linux:8::appstreamphp-pecl-xdebug3, php-pecl-xdebug3-debuginfo, php-pecl-xdebug3-debugsource0:3.1.2-1.module+el8.6.0+13671+84712317RHSA-2022:5468
11 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 morephp77.2.34-150000.4.103.1SUSE-SU-2022:4067-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 morephp77.2.5-150000.4.95.1SUSE-SU-2022:2275-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 8 morephp77.4.33-150200.3.46.2SUSE-SU-2022:4069-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 8 morephp77.4.6-150200.3.41.1SUSE-SU-2022:2185-1
SUSELinux Enterprise Module for Legacy 15 SP4php7, php7-fpm, php7-fastcgi and 1 more7.4.25-150400.4.8.1SUSE-SU-2022:2292-1
SUSELinux Enterprise Module for Legacy 15 SP4php7, php7-fpm, php7-fastcgi and 1 more7.4.33-150400.4.13.1SUSE-SU-2022:3997-1
SUSELinux Enterprise Module for Package Hub 15 SP4php7-embed7.4.25-150400.4.8.1SUSE-SU-2022:2292-1
SUSELinux Enterprise Module for Package Hub 15 SP4php7-embed7.4.33-150400.4.13.1SUSE-SU-2022:3997-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Software Development Kit 12 SP5php727.2.5-1.81.1SUSE-SU-2022:2183-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Software Development Kit 12 SP5php747.4.33-1.47.2SUSE-SU-2022:4068-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Software Development Kit 12 SP5php747.4.6-1.42.1SUSE-SU-2022:2161-1
SUSELinux Enterprise Module for Web and Scripting 15 SP4php8, php8-fpm, php8-test and 3 more8.0.10-150400.4.8.1SUSE-SU-2022:2303-1
openSUSELeap 15.3php7, php7-test7.4.33-150200.3.46.2SUSE-SU-2022:4069-1
openSUSELeap 15.3php7, php7-test7.4.6-150200.3.41.1SUSE-SU-2022:2185-1
openSUSELeap 15.4php77.2.34-150000.4.103.1SUSE-SU-2022:4067-1
openSUSELeap 15.4php77.2.5-150000.4.95.1SUSE-SU-2022:2275-1
openSUSELeap 15.4php77.4.33-150200.3.46.2SUSE-SU-2022:4069-1
openSUSELeap 15.4php77.4.6-150200.3.41.1SUSE-SU-2022:2185-1
openSUSELeap 15.4php7, php7-fpm, php7-embed and 2 more7.4.33-150400.4.13.1SUSE-SU-2022:3997-1
openSUSELeap 15.4php7, php7-fpm, php7-test and 3 more7.4.25-150400.4.8.1SUSE-SU-2022:2292-1
openSUSELeap 15.4php7-test7.4.33-150400.4.13.2SUSE-SU-2022:3997-1
openSUSELeap 15.4php8, php8-fpm, php8-test and 3 more8.0.10-150400.4.8.1SUSE-SU-2022:2303-1
openSUSETumbleweedphp88.2.10-3.1openSUSE-SU-2024:13267-1
AlmaLinux8apcu-panel, php-pecl-apcu, php-pecl-apcu-devel5.1.20-1.module_el8.6.0+2739+efabdb8fALSA-2022:5468
AlmaLinux8libzip, libzip-devel, libzip-tools1.7.3-1.module_el8.6.0+2739+efabdb8fALSA-2022:5468
AlmaLinux8php-pear1:1.10.13-1.module_el8.6.0+3268+b150a051ALSA-2022:5468
AlmaLinux8php-pecl-rrd2.0.3-1.module_el8.6.0+2739+efabdb8fALSA-2022:5468
AlmaLinux8php-pecl-xdebug33.1.2-1.module_el8.6.0+2739+efabdb8fALSA-2022:5468
AlmaLinux8php-pecl-zip1.19.2-1.module_el8.6.0+2739+efabdb8fALSA-2022:5468
AlmaLinux9php, php-gd, php-cli and 22 more8.0.13-2.el9_0ALSA-2022:5904
Rocky Linux8libzip0:1.6.1-1.module+el8.4.0+415+e936cba3RLSA-2022:5467
Rocky Linux8libzip0:1.6.1-1.module+el8.6.0+789+2130c178RLSA-2022:5467
Rocky Linux8libzip0:1.7.3-1.module+el8.6.0+790+fc63e43fRLSA-2022:5468
Rocky Linux8php0:7.4.19-3.module+el8.6.0+990+389ef54aRLSA-2022:5467
Rocky Linux8php0:8.0.13-3.module+el8.6.0+989+3fbff15cRLSA-2022:5468
Rocky Linux8php-pear1:1.10.12-1.module+el8.4.0+415+e936cba3RLSA-2022:5467
Rocky Linux8php-pear1:1.10.12-1.module+el8.6.0+789+2130c178RLSA-2022:5467
Rocky Linux8php-pear1:1.10.13-1.module+el8.6.0+1006+0d5a469fRLSA-2022:5468
Rocky Linux8php-pear1:1.10.13-1.module+el8.7.0+1067+0a7071ccRLSA-2022:5468
Rocky Linux8php-pecl-apcu0:5.1.18-1.module+el8.4.0+415+e936cba3RLSA-2022:5467
Rocky Linux8php-pecl-apcu0:5.1.18-1.module+el8.6.0+789+2130c178RLSA-2022:5467
Rocky Linux8php-pecl-apcu0:5.1.20-1.module+el8.6.0+790+fc63e43fRLSA-2022:5468
8 more for Rocky Linux in the JSON.
Alpinev3.14, v3.15php77.4.32-r0ALPINE-CVE-2022-31626
Alpinev3.14, v3.16php88.0.24-r0ALPINE-CVE-2022-31626
Alpinev3.15php88.0.25-r0ALPINE-CVE-2022-31626
Alpinev3.16php818.1.7-r0ALPINE-CVE-2022-31626
Alpinev3.17, v3.18, v3.19php818.1.6-r2ALPINE-CVE-2022-31626

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8php:7.4-8060020220622080643.5caa48ffFixed 2022-06-30RHSA-2022:5467
Red Hat Enterprise Linux 8php:8.0-8060020220622070726.5caa48ffFixed 2022-06-30RHSA-2022:5468
Red Hat Enterprise Linux 8.4 Extended Update Supportphp:7.4-8040020220622090235.d7c09045Fixed 2022-06-30RHSA-2022:5471
Red Hat Enterprise Linux 9php-0:8.0.13-2.el9_0Fixed 2022-08-04RHSA-2022:5904
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-php73-php-0:7.3.33-1.el7Fixed 2022-07-04RHSA-2022:5491
Red Hat Enterprise Linux 6phpNot affected
Red Hat Enterprise Linux 7phpNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-31626.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-26-027-02Festo Didactic SE MES PC2024-02-27Commercial Facilities, Communications, Critical Manufacturing, EnergyFesto Didactic SE MES PC shipped with Windows 10none listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-120 (13).

References

Check your stackJSON