Medium, CVSS 4.9GoPublished
Vitess vulnerable to infinite memory consumption and vtgate crash
CVE-2024-32886 · GHSA-649x-hxfx-57j2
- Affected
- Go github.com/vitessio/vitess >= 19.0.0, < 19.0.4; >= 18.0.0, < 18.0.5; < 17.0.7
- Fixed in
- 19.0.417.0.718.0.5· Vendor fix available
- Issue
- 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. 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: https://github.com/vitessio/vitess/blob/8f6cfaaa643a08dc111395a75a2d250ee746cfa8/go/mysql/collations/charset/unicode/utf16.go#L69-L71 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…
Recommended action: Upgrade to 19.0.4, 18.0.5 or 17.0.7 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.