CVE-2022-41881: Netty codec haproxy Denial of Service Vulnerability
MODERATECVE-2022-41881 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-674: Uncontrolled Recursion) affecting Netty codec haproxy libraries in the Maven ecosystem. The issue involves haproxymessagedecoder stack exhaustion dos. Remediation is available by upgrading affected packages to version 4.1.86.Final.
CVE-2022-41881 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2022-41881
To remediate this vulnerability, upgrade all affected Netty codec haproxy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-haproxy</artifactId>
<version>4.1.86.Final</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=io.netty
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-41881, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.netty
Analyze the terminal output to locate any version of Netty codec haproxy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.86.Final), your application is affected.
Note: The mvn dependency:tree -Dincludes=io.netty command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In Netty codec haproxy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-41881 Affected Netty codec haproxy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.netty:netty-codec-haproxy
|
Maven |
< 4.1.86.Final
|
4.1.86.Final
|
References
Frequently Asked Questions
What is CVE-2022-41881?
Which Netty codec haproxy versions are affected?
What version fixes CVE-2022-41881?
Is netty-codec-haproxy affected?
What is the CVSS score of CVE-2022-41881?
What CWE is associated with CVE-2022-41881?
How can I check Maven dependencies for CVE-2022-41881?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fx2c-96vj-985v",
"modified" : "2023-01-13T17:18:24Z",
"published" : "2022-12-12T21:24:29Z",
"aliases" : [ "CVE-2022-41881" ],
"summary" : "HAProxyMessageDecoder Stack Exhaustion DoS",
"details" : "### Impact\nA StackOverflowError can be raised when parsing a malformed crafted message due to an infinite recursion.\n\n### Patches\nUsers should upgrade to 4.1.86.Final.\n\n### Workarounds\nThere is no workaround, except using a custom HaProxyMessageDecoder.\n\n### References\nWhen parsing a TLV with type = PP2_TYPE_SSL, the value can be again a TLV with type = PP2_TYPE_SSL and so on.\nThe only limitation of the recursion is that the TLV length cannot be bigger than 0xffff because it is encoded in an unsigned short type.\nProviding a TLV with a nesting level that is large enough will lead to raising of a StackOverflowError.\nThe StackOverflowError will be caught if HAProxyMessageDecoder is used as part of Netty’s ChannelPipeline, but using it directly without the ChannelPipeline will lead to a thrown exception / crash.\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [netty](https://github.com/netty/netty)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.netty:netty-codec-haproxy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.86.Final"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/netty/netty/security/advisories/GHSA-fx2c-96vj-985v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41881"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/netty/netty"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/01/msg00008.html"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20230113-0004"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2023/dsa-5316"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-674" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-12T21:24:29Z",
"nvd_published_at" : "2022-12-12T18:15:00Z"
}
}