Am I affected?
CVE-2022-31626
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.
Not in the CISA KEV catalog as of the last sync. That means no confirmed exploitation is listed there, not that it is safe.
Exploit probability (FIRST EPSS): 58.1% chance of exploitation activity in the next 30 days (top 1% of all scored CVEs), scored 2026-11-23. EPSS is a likelihood estimate, not proof of attacks.
Check your PHP version
Fixed versions by branch
| Branch | Affected (php.net) | Fixed in |
|---|---|---|
| PHP 8.1 | PHP 8.1 only, 8.1.0 (including) to 8.1.7 (excluding) | 8.1.7 |
| PHP 8.0 | PHP 8.0 only, 8.0.0 (including) to 8.0.20 (excluding) | 8.0.20 |
| PHP 7.4 | PHP 7.4 only, 7.4.0 (including) to 7.4.30 (excluding) | 7.4.30 |
"Fixed in" is shown only when the source gives an exact upper bound. Any later patch in the same branch also has the fix. Linux distributions (Ubuntu, Debian, RHEL) often backport fixes without changing the PHP version number.
Related CVEs
Other PHP CVEs that NVD lists for the same branches.
- CVE-2022-37454 Critical 9.8 · PHP 8.1, 8.0, 7.4 · 2022-10-21
- CVE-2021-21708 Critical 9.8 · PHP 8.1, 8.0, 7.4 · 2022-02-27
- CVE-2022-31625 High 8.1 · PHP 8.1, 8.0, 7.4 · 2022-06-16
- CVE-2022-31630 High 7.1 · PHP 8.1, 8.0, 7.4 · 2022-11-14
- CVE-2022-31629 Medium 6.5 · PHP 8.1, 8.0, 7.4 · 2022-09-28
- CVE-2022-31628 Medium 5.5 · PHP 8.1, 8.0, 7.4 · 2022-09-28
Questions
- Which PHP versions are affected by CVE-2022-31626?
- php.net lists these affected ranges: PHP 8.1 only, 8.1.0 (including) to 8.1.7 (excluding); PHP 8.0 only, 8.0.0 (including) to 8.0.20 (excluding); PHP 7.4 only, 7.4.0 (including) to 7.4.30 (excluding).
- Which PHP version fixes CVE-2022-31626?
- According to php.net, the fix is in PHP 8.1.7, 8.0.20, 7.4.30 (upgrade to that release or any later patch in the same branch).
- Does a version check prove my server is safe from CVE-2022-31626?
- No. The SAPI, web server, operating system, loaded extensions and configuration change whether a bug can be reached, and Linux distributions often backport fixes without changing the upstream version number.
Sources: CVE-2022-31626 on NIST NVD and the php.net ChangeLog. NVD data synced 2026-11-24T03:47:46.548Z. See all PHP CVEs in the CVE explorer.