| Field | Value |
|-------|-------|
| Product | Netty |
| Version | 4.2.12.Final (and all prior versions with codec-redis) |
| Component | io.netty.handler.codec.redis.RedisEncoder |
| Vulnerability Type | CWE-93: Improper Neutralization of CRLF Sequences (CRLF Injection) |
| Impact | Redis Command Injection / Response Poisoning |
| Attack Vector | Network |
| Attack Complexity | Low |
| Privileges Required | None |
| User Interaction | None |
| Scope | Unchanged |
| Confidentiality Impact | High |
| Integrity Impact | High |
| Availability Impact | None |
The following classes in the codec-redis module are affected:
io.netty.handler.codec.redis.RedisEncoder (encoder - no output validation)io.netty.handler.codec.redis.InlineCommandRedisMessage (no input validation)io.netty.handler.codec.redis.SimpleStringRedisMessage (no input validation)io.netty.handler.codec.redis.ErrorRedisMessage (no input validation)io.netty.handler.codec.redis.AbstractStringRedisMessage (base class - no validation)The Netty Redis codec encoder (RedisEncoder) writes user-controlled string content directly to the network output buffer without validating or sanitizing CRLF (\r\n) characters. Since the Redis Serialization Protocol (RESP) uses CRLF as the command/response delimiter, an attacker who can control the content of a Redis message can inject arbitrary Redis commands or forge fake responses.
In RedisEncoder.java, the writeString() method (lines 103-111) writes content using ByteBufUtil.writeUtf8() without any validation:
private static void writeString(ByteBufAllocator allocator, RedisMessageType type,
String content, List<Object> out) {
ByteBuf buf =...
4.1.133.Final4.2.13.FinalExploitability
AV:LAC:LPR:NUI:NScope
S:UImpact
C:LI:HA:N6.8/CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N