CVE-2021-20220: HTTP Request Smuggling in Undertow

io.undertow:undertow-core Updated 02 Oct 2025

Summary

16/06/2021
Yes i
Moderate
4.8

CVE-2021-20220: HTTP request smuggling in Undertow. Affects io.undertow:undertow-core across 2 version ranges.

< 2.0.34 >= 2.1.0, < 2.1.6

Fixed in 2.0.34 or 2.1.6, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-20220 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Undertow is a lightweight web server written in Java that is used to build high-performance web applications. It provides a flexible and extensible architecture for handling HTTP requests and responses. Undertow is vulnerable to HTTP request smuggling, which allows an attacker to manipulate HTTP requests in a way that can lead to various security issues.

Vulnerability Detail

The vulnerability in Undertow is a regression in the fix for CVE-2020-10687. It allows for HTTP request smuggling related to CVE-2017-2666, enabling attackers to send requests with invalid characters that can bypass security measures. This vulnerability affects both HTTP/1.x and HTTP/2 protocols. Exploiting this flaw can result in web-cache poisoning, cross-site scripting (XSS) attacks, or unauthorized access to sensitive information from requests other than the attacker's own. The severity of this vulnerability is rated as MODERATE with a CVSS score of 4.8.

How To Fix

Latest published version: 2.4.4.Final as of 23 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.0.34 2.0.34
  • >= 2.1.0, < 2.1.6 2.1.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading Undertow is not immediately feasible, a possible workaround is to implement a filtering mechanism that sanitizes incoming HTTP requests. This can involve validating and removing any invalid characters or ensuring that the server rejects requests with such characters. Here is an example of a Java Servlet Filter that can be used as a workaround:

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class RequestFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        // Initialization code
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if (request instanceof HttpServletRequest) {
            HttpServletRequest httpRequest = (HttpServletRequest) request;
            String requestURI = httpRequest.getRequestURI();
            // Validate and sanitize the requestURI
            // Implement additional checks if necessary
        }
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        // Cleanup code
    }

}

This filter can be configured in the web.xml file of the application to intercept incoming requests and perform the necessary checks.

Conclusion

The vulnerability in Undertow allows for HTTP request smuggling, which can lead to various security issues. It is recommended to upgrade to the latest version of Undertow (2.1.6 or later) to fix this vulnerability. If immediate upgrade is not possible, implementing a filtering mechanism as a workaround can help mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for io.undertow:undertow-core →

Share this vulnerability

FAQ

Undertow is a lightweight web server written in Java that provides a flexible and extensible architecture for handling HTTP requests and responses.

HTTP request smuggling is a technique where an attacker manipulates the HTTP requests in a way that can bypass security measures and lead to various security issues.

Exploiting this vulnerability can result in web-cache poisoning, cross-site scripting (XSS) attacks, or unauthorized access to sensitive information from requests other than the attacker's own.

To fix this vulnerability, it is recommended to upgrade the affected version of Undertow to 2.1.6 or later. Updating the Undertow dependency in the project's Maven configuration will mitigate the vulnerability.

If upgrading Undertow is not immediately feasible, a possible workaround is to implement a filtering mechanism that sanitizes incoming HTTP requests. This can involve validating and removing any invalid characters or ensuring that the server rejects requests with such characters.

Related vulnerabilities

Recent vulnerabilities recorded for io.undertow:undertow-core.

How To Fix

Latest published version: 2.4.4.Final as of 23 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.0.34 2.0.34
  • >= 2.1.0, < 2.1.6 2.1.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback