REDHAT-BUG-2588744: Medium severity maven/io.netty/netty-codec-http vulnerability
Netty's HttpPostRequestEncoder builds multipart part headers by concatenating the filename and content type of a FileUpload directly into the Content-Disposition and Content-Type headers. MemoryFileUpload and DiskFileUpload only null-check these values and do not reject, escape, or strip carriage return and line feed characters. Field names are already sanitized, but filenames and content types are not. A filename or content type containing CRLF sequences can therefore end the current part header and start additional, attacker-controlled header lines in the generated multipart body.
The impact is multipart part-header injection in outbound requests generated by Netty. Downstream services that make decisions from per-part metadata, such as upload filters that trust the per-part Content-Type, routing or validation based on Content-Disposition parameters, or multipart parsers and gateways that handle duplicate or unexpected part headers inconsistently, may be misled. The issue does not allow injection of top-level HTTP request headers, and no server compromise or request desynchronization has been shown.
Applications are affected if they use HttpPostRequestEncoder in netty-codec-http to re-post or relay uploaded files, and the filename or content type of those files can be influenced by an attacker. This includes upload relays, proxies, and API gateways that preserve client-supplied file metadata. Affected versions are 4.1.0.Final through 4.1.138.Final and 4.2.0.Final through 4.2.18.Final. The issue is fixed in 4.1.139.Final and 4.2.19.Final.
Affected versions: >= 4.1.0.Final, <= 4.1.138.Final; >= 4.2.0.Final, <= 4.2.18.Final Patched versions: 4.1.139.Final; 4.2.19.Final CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N (5.3) CWE: CWE-93, CWE-113 Upstream advisory: https://github.com/netty/netty/security/advisories/GHSA-6g26-xhvx-g5w3 CVE requested by the Netty Project via PSIRTSUPT-32166.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.1.139.Final - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.2.19.Final
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications are affected if they use HttpPostRequestEncoder from netty-codec-http to generate multipart outbound requests and allow attacker-controlled values to reach a FileUpload filename or content type. The practical impact depends on downstream services relying on multipart per-part metadata.
What does an attacker need to control to exploit it?
An attacker needs to cause a filename or content type associated with a MemoryFileUpload or DiskFileUpload to contain carriage return and line feed sequences. Those sequences can terminate the intended multipart part header and add attacker-controlled part-header lines.
Can this inject headers into the overall HTTP request or enable request smuggling?
No. The described injection is limited to headers within an individual multipart body part; it does not inject top-level HTTP request headers. No server compromise or request desynchronization has been shown.
What risk exists if the application cannot be updated immediately?
Do not allow untrusted filenames or content-type values containing carriage return or line feed characters to be used when constructing FileUpload objects for HttpPostRequestEncoder. Downstream upload filters, validators, gateways, and multipart parsers should not blindly trust per-part Content-Type or Content-Disposition metadata.