CVE-2021-21295 Possible request smuggling in HTTP/2 due missing validation

Medium 5.9 Published Updated
Exploited in the wild
Not known
Fix
Available

What is CVE-2021-21295?

CVE-2021-21295 is a medium-severity vulnerability in Debian Debian Linux, published on 9 Mar 2021.

Official description

Netty is an open-source, asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. In Netty (io.netty:netty-codec-http2) before version 4.1.60.Final there is a vulnerability that enables request smuggling. If a Content-Length header is present in the original HTTP/2 request, the field is not validated by `Http2MultiplexHandler` as it is propagated up. This is fine as long as the request is not proxied through as HTTP/1.1. If the request comes in as an HTTP/2 stream, gets converted into the HTTP/1.1 domain objects (`HttpRequest`, `HttpContent`, etc.) via `Http2StreamFrameToHttpObjectCodec `and then sent up to the child channel's pipeline and proxied through a remote peer as HTTP/1.1 this may result in request smuggling. In a proxy case, users may assume the content-length is validated somehow, which is not the case. If the request is forwarded to a backend channel that is a HTTP/1.1 connection, the Content-Length now has meaning and needs to be checked. An attacker can smuggle requests inside the body as it gets downgraded from HTTP/2 to HTTP/1.1. For an example attack refer to the linked GitHub Advisory. Users are only affected if all of this is true: `HTTP2MultiplexCodec` or `Http2FrameCodec` is used, `Http2StreamFrameToHttpObjectCodec` is used to convert to HTTP/1.1 objects, and these HTTP/1.1 objects are forwarded to another remote peer. This has been patched in 4.1.60.Final As a workaround, the user can do the validation by themselves by implementing a custom `ChannelInboundHandler` that is put in the `ChannelPipeline` behind `Http2StreamFrameToHttpObjectCodec`.

Weakness: CWE-444

Which versions are affected by CVE-2021-21295?

7 open source packages ship an affected version, including io.netty:netty, zookeeper and io.netty:netty-codec-http2. It affects 8 products.

PackageAffectedFixed in
io.netty:netty MavenAll versionsNone
io.netty:netty MavenAll versionsNone
zookeeper BitnamiFrom 3.5.93.5.10
io.netty:netty-codec-http2 MavenFrom 4.0.04.1.60.Final
io.netty:netty-codec-http2 MavenFrom 4.0.04.1.60.Final
org.jboss.netty:netty MavenAll versionsNone
1 more packages
org.jboss.netty:netty MavenAll versionsNone
Linux distribution packages (1)
netty openSUSE:Leap 15.2All versions4.1.13-lp152.3.3.1

Products include Apache Kudu, Apache Zookeeper, Debian Debian Linux, Netapp Oncommand Api Services, Netapp Oncommand Workflow Automation, Netty Netty and 2 more.

How do I fix CVE-2021-21295?

Upgrade to a fixed version.

Is CVE-2021-21295 being exploited?

There is no known exploitation of CVE-2021-21295 in the wild and no public exploit code.

Sources

Also known as BIT-zookeeper-2021-21295, CLEANSTART-2026-GV36158, DEBIAN-CVE-2021-21295, GHSA-wm47-8v5p-wjpj, UBUNTU-CVE-2021-21295, openSUSE-SU-2021:0448-1.

Is CVE-2021-21295 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free