GHSA-7f58-g87w-gx7p: Heap exhaustion via unbounded simple string or bulk string allocation in Vert.x Redis client
In Eclipse Vert.x versions [4.0.0, 4.5.35] or [5.0.0, 5.2.2], when a malicious server keeps sending bytes on an EOL-terminated line (not length-prefixed, for example a simple string [1]), we'll keep growing the buffer without bounds, eventually leading to an OOM. We need to have a configurable limit for EOL-terminated lines.
If a malicious server sends a specially crafted RESP response (for example a bulk string [2] with missing CRLF trailer), the parser enters an infinite loop where it keeps parsing the same buffer and pushing the same response to the caller, which may lead e.g. to an OOM if the consumer just buffers the responses. We must fix the parser to avoid this infinite looping.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Configure a bounded maximum for EOL-terminated lines to prevent unbounded buffer growth.
Vert.x Redis client EOL-terminated line length limit
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker must be able to act as, or control responses from, a Redis server that the Vert.x Redis client connects to. They can send an EOL-terminated RESP line without a terminating end-of-line or a malformed bulk-string response missing its CRLF trailer; no authentication or user interaction is required.
Which deployments are affected?
Eclipse Vert.x Redis client versions 4.0.0 through 4.5.35 and 5.0.0 through 5.2.2 are affected. Clients that do not connect to an attacker-controlled or malicious Redis server are not exposed to the described malicious-response path.
What is the impact of each malformed response pattern?
An unterminated EOL-terminated line causes the client buffer to grow without bounds until out-of-memory conditions occur. A bulk-string response with a missing CRLF trailer can cause repeated parsing of the same buffer and repeated delivery of the same response, which can also lead to out-of-memory if the consumer buffers those responses.