Summary
Vitess vulnerable to infinite memory consumption and vtgate crash
When executing the following simple query, the vtgate will go into an endless loop that also keeps consuming memory and eventually will OOM.
Details
When running the following query, the evalengine will try evaluate it and runs forever.
select _utf16 0xFF
The source of the bug lies in the collation logic that we have. The bug applies to all utf16, utf32 and ucs2 encodings. In general, the bug is there for any encoding where the minimal byte length for a single character is more than 1 byte.
The decoding functions for these collations all implement logic like the following to enforce the minimal character length:
The problem is that all the callers of DecodeRune expect progress by returning the number of bytes consumed. This means that if there's only 1 byte left in an input, it will here return still 0 and the caller(s) don't consume the character.
One example of such a caller is the following:
The logic here moves forward the pointer in the input []byte but if DecodeRune returns 0 in case of error, it will keep running forever. The OOM happens since it keeps adding the ? as the invalid character to the destination buffer infinitely, growing forever until it runs out of memory.
The fix here would be to always return forward progress also on invalid strings.
There's also a separate bug here that even if progress is guaranteed, select _utf16 0xFF will return the wrong result currently. MySQL will pad here the input when the _utf16 introducer is used with leading 0x00 bytes and then decode to UTF-16, resulting in the output of ÿ here.
PoC
select _utf16 0xFF
Impact
Denial of service attack by triggering unbounded memory usage.
CVE-2024-32886 has a CVSS score of 4.9 (Medium). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (19.0.4, 18.0.5, 17.0.7, 0.17.7, 0.18.5, 0.19.4); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
github.com/vitessio/vitess to 19.0.4 or later; github.com/vitessio/vitess to 18.0.5 or later; github.com/vitessio/vitess to 17.0.7 or later; vitess.io/vitess to 0.17.7 or later; vitess.io/vitess to 0.18.5 or later; vitess.io/vitess to 0.19.4 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2024-32886? CVE-2024-32886 is a medium-severity security vulnerability in github.com/vitessio/vitess (go), affecting versions >= 19.0.0, < 19.0.4. It is fixed in 19.0.4, 18.0.5, 17.0.7, 0.17.7, 0.18.5, 0.19.4.
- How severe is CVE-2024-32886? CVE-2024-32886 has a CVSS score of 4.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2024-32886?
github.com/vitessio/vitess(go) (versions >= 19.0.0, < 19.0.4)vitess.io/vitess(go) (versions < 0.17.7)
- Is there a fix for CVE-2024-32886? Yes. CVE-2024-32886 is fixed in 19.0.4, 18.0.5, 17.0.7, 0.17.7, 0.18.5, 0.19.4. Upgrade to this version or later.
- Is CVE-2024-32886 exploitable, and should I be worried? Whether CVE-2024-32886 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-32886 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-32886?
- Upgrade
github.com/vitessio/vitessto 19.0.4 or later - Upgrade
github.com/vitessio/vitessto 18.0.5 or later - Upgrade
github.com/vitessio/vitessto 17.0.7 or later - Upgrade
vitess.io/vitessto 0.17.7 or later - Upgrade
vitess.io/vitessto 0.18.5 or later - Upgrade
vitess.io/vitessto 0.19.4 or later
- Upgrade