# GHSA-CC6X-FFM5-83WF: SOCKS4/5 Proxy Encoder Null Byte and Credential Injection

- Database: GitHub
- Severity: CVSS 7.5 (High)
- Published: 2026-08-07
- Modified: 2026-09-09

## Affected versions

- io.netty:netty-codec-socks (Maven): from 4.2.0.Final, through 4.2.16.Final
- io.netty:netty-codec-socks (Maven): through 4.1.136.Final

## Description

# Security Vulnerability Report: SOCKS4/5 Proxy Encoder Null Byte and Credential Injection in Netty

## 1. Vulnerability Summary

| Field | Value |
|-------|-------|
| **Product** | Netty |
| **Version** | 4.2.12.Final (and all prior versions with codec-socks) |
| **Component** | `io.netty.handler.codec.socksx.v4.Socks4ClientEncoder` / `io.netty.handler.codec.socksx.v5.Socks5ClientEncoder` |
| **Vulnerability Type** | CWE-626: Null Byte Interaction Error / CWE-20: Improper Input Validation |
| **Impact** | Domain Spoofing / SOCKS4 UserId Truncation / Authentication Data Injection |
| **CVSS 3.1 Score** | **7.5 (High)** |
| **CVSS 3.1 Vector** | `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N` |

## 2. Affected Components

**SOCKS5**:
- `Socks5ClientEncoder` — domain address field accepts null bytes
- `Socks5ClientEncoder` — password auth request accepts null bytes and CRLF in username/password

**SOCKS4**:
- `Socks4ClientEncoder` — userid field accepts embedded null bytes (creates ambiguous null-terminated string)
- `Socks4ClientEncoder` — SOCKS4a domain field accepts embedded null bytes (domain truncation)

## 3. Vulnerability Description

### 3.1 SOCKS5 Domain Null Byte Injection

SOCKS5 domain addresses are encoded as 1-byte length + domain string. Null bytes within the domain string are accepted without validation:

```
Encoded: [05 01 00 03] [11] evil\0.example.com [01 BB]
                        ↑len=17         ↑null byte in domain
```

Different SOCKS5 proxy implementations handle embedded null bytes differently:
- Some truncate at null → connect to `evil` instead of `evil\0.example.com`
- Some process the full string → connect to the intended host
- This differential behavior enables **domain spoofing**

### 3.2 SOCKS5 Auth Credential Injection

SOCKS5 password authentication (RFC 1929) uses 1-byte length + string for username and password. Null bytes and CRLF characters are accepted:

```
Encoded: [01] [0B] admin\0root [10] pass\r\ninjected
              ↑len  ↑null       ↑len ↑CRLF
```

If the SOCKS5 proxy uses null-terminated string processing, the username becomes `admin` (truncated), and the password may be similarly truncated or misinterpreted.

### 3.3 SOCKS4 UserId Null Byte Truncation

SOCKS4 uses null-terminated strings for userid. An embedded null byte creates **two null bytes** in the packet — the embedded one and the protocol terminator. This makes the packet structurally ambiguous:

```
Standard:  [header 8 bytes] [userid] [00]
Injected:  [header 8 bytes] [admin] [00] [injected-userid] [00]
                                     ↑ proxy stops here ↑ trailing data
```

The trailing data after the first null byte may be interpreted as:
- Start of SOCKS4a domain (if IP is 0.0.0.x)
- Garbage data (protocol confusion)

### 3.4 SOCKS4a Domain Null Byte Truncation

SOCKS4a appends a null-terminated domain after the userid. An embedded null creates the same ambiguity:

```
Standard:  [header] [userid\0] [domain\0]
Injected:  [header] [user\0]   [evil\0.example.com\0]
                                     ↑ proxy connects to "evil"
```

## 5. Impact Analysis

| Impact Category | Description |
|----------------|-------------|
| **Domain Spoofing** | Null byte truncation connects to `evil` instead of `evil.example.com` |
| **Auth Bypass** | Null byte in username truncates to shorter name, potentially matching a different account |
| **Protocol Confusion** | Extra null bytes in SOCKS4 packets create ambiguous protocol framing |
| **SSRF** | Combined with domain spoofing, can redirect proxy connections to internal hosts |



## 7. References

- [RFC 1928: SOCKS Protocol Version 5](https://tools.ietf.org/html/rfc1928)
- [RFC 1929: Username/Password Authentication for SOCKS V5](https://tools.ietf.org/html/rfc1929)
- [CWE-626: Null Byte Interaction Error](https://cwe.mitre.org/data/definitions/626.html)

## References

- https://github.com/netty/netty/security/advisories/GHSA-cc6x-ffm5-83wf

Page: https://cve.now/GHSA-CC6X-FFM5-83WF

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
