Skip to content

GHSA-hh82-3pmq-7frp CVE-2022-41915

Netty vulnerable to HTTP Response splitting from assigning header value iterator

Medium Maven
Severity
6.5 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.95%
Chance of exploitation in the next 30 days. Higher than 61.33% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
CWE-436 Interpretation Conflict
Fix
4.1.86.Final
Upgrade io.netty:netty-codec-http to this version or later

Description

Impact

When calling DefaultHttpHeaders.set with an iterator of values (as opposed to a single given value), header value validation was not performed, allowing malicious header values in the iterator to perform HTTP Response Splitting.

Patches

The necessary validation was added in Netty 4.1.86.Final.

Workarounds

Integrators can work around the issue by changing the DefaultHttpHeaders.set(CharSequence, Iterator<?>) call, into a remove() call, and call add() in a loop over the iterator of values.

References

HTTP Response Splitting CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers

For more information

If you have any questions or comments about this advisory:

Affected versions

Maven

PackageVulnerableFixed in
io.netty:netty-codec-http
>= 4.1.83.Final, < 4.1.86.Final
4.1.86.Final

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

io.netty:netty-codec-http Maven → 4.1.86.Final

maven
<dependency><groupId>io.netty</groupId><artifactId>netty-codec-http</artifactId><version>4.1.86.Final</version></dependency>
gradle
implementation("io.netty:netty-codec-http:4.1.86.Final")

Severity breakdown

CVSS 3.1 6.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')

The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.

How to prevent it
  • Implementation: Construct HTTP headers very carefully, avoiding the use of non-validated input data.
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. If an input does not strictly conform to specifications, reject it or transform it into something that conforms. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Implementation: Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

CWE-436: Interpretation Conflict

Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-8c42-7qj2-3j46
Netty Vulnerable to Cache Poisoning and Information Disclosure via CORS Vary Header Overwrite
High Also affects io.netty:netty-codec-http
GHSA-gcjf-9mgh-3p7g
Netty: CRLF Injection via Multipart Filename in Netty HttpPostRequestEncoder
Medium Also affects io.netty:netty-codec-http
GHSA-q4f6-jm68-57ww
Netty: [HttpContentEncoder] Unbounded Per-Connection Queue Growth via HTTP/1.1 Pipelining Leads to Denial of Service
High Also affects io.netty:netty-codec-http
GHSA-4mp9-239f-g9hg
Netty: WebSockets V07/V08 handshaker missing Connection/Upgrade validation
High Also affects io.netty:netty-codec-http
GHSA-6cqp-g7gg-8hr5
Netty: Security Control Bypass via CORS Short-Circuit Failure
Medium Also affects io.netty:netty-codec-http
GHSA-jppx-w49h-x2qq
Netty: [SpdyHttpDecoder] ByteBuf Reference Leak on RST_STREAM Leads to Native Memory Exhaustion
High Also affects io.netty:netty-codec-http
GHSA-mvh2-crg5-v77c
Netty SPDY zlib header block continues decoded expansion after maxHeaderSize truncation
High Also affects io.netty:netty-codec-http
GHSA-6jqx-86gh-f27w
Netty SPDY SETTINGS frame count materializes unbounded settings map
High Also affects io.netty:netty-codec-http
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor