CVE-2021-34429: Encoded URIs can access WEB-INF directory in Eclipse Jetty

Summary

19/07/2021
Yes i
Moderate
5.3

CVE-2021-34429: Encoded URIs can access WEB-INF directory in Eclipse Jetty. Affects org.eclipse.jetty:jetty-webapp across 3 version ranges.

>= 9.4.37, < 9.4.43 >= 10.0.1, < 10.0.6 >= 11.0.1, < 11.0.6

Fixed in 9.4.43, 10.0.6 or 11.0.6, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-34429 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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The org.eclipse.jetty:jetty-webapp package is an open-source Java web server and servlet container. It provides support for deploying web applications and serving HTTP requests. The package is widely used in various Java-based web applications and frameworks.

Vulnerability Detail

URIs can be crafted using encoded characters to access the content of the WEB-INF directory and bypass security constraints in Eclipse Jetty. This vulnerability allows an attacker to retrieve sensitive information about the implementation of a web application. The default compliance mode in Jetty allows requests with URIs containing %u002e segments to access protected resources within the WEB-INF directory. Additionally, an encoded null character can prevent correct normalization, allowing the retrieval of the web.xml file. This vulnerability is a variation of the previously reported CVE-2021-28164/GHSA-v7ff-8wcx-gmc5 vulnerability.

How To Fix

Fixed versions by release line

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

  • >= 9.4.37, < 9.4.43 9.4.43
  • >= 10.0.1, < 10.0.6 10.0.6
  • >= 11.0.1, < 11.0.6 11.0.6

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

Workaround

A workaround for this vulnerability is to deploy Jetty rewrite rules that rewrite any request containing encoded dot segments or null characters in the raw request URI to a known not found resource. Here is an example of the rewrite rules:

<Call name="addRule">
  <Arg>
    <New class="org.eclipse.jetty.rewrite.handler.RewriteRegexRule">
      <Set name="regex">.*/(?:\.+/)+.*</Set>
      <Set name="replacement">/WEB-INF/Not-Found</Set>
    </New>
  </Arg>
</Call>
<Call name="addRule">
  <Arg>
    <New class="org.eclipse.jetty.rewrite.handler.ValidUrlRule"/>
  </Arg>
</Call>

These rules will rewrite any request with encoded dot segments or null characters in the URI to the /WEB-INF/Not-Found resource, preventing access to protected resources.

Conclusion

The CVE-2021-34429 vulnerability in the org.eclipse.jetty:jetty-webapp package allows attackers to access protected resources within the WEB-INF directory and retrieve sensitive information about a web application's implementation. Upgrading to the latest version of Jetty (9.4.43, 10.0.6, or 11.0.6) or applying the provided workaround will mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.eclipse.jetty:jetty-webapp →

Share this vulnerability

FAQ

The vulnerability allows an attacker to access the content of the WEB-INF directory and retrieve sensitive information about the implementation of a web application. This can potentially expose security vulnerabilities and aid in further attacks.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using just the pom.xml file.

Yes, a workaround for this vulnerability is to deploy Jetty rewrite rules that rewrite requests with encoded dot segments or null characters in the URI to a known not found resource. The provided example rewrite rules can be used as a starting point.

The recommended fix is to upgrade to the latest version of the org.eclipse.jetty:jetty-webapp package (9.4.43, 10.0.6, or 11.0.6). These releases include fixes that restore several lines of defense against URI alias attacks and ensure proper decoding and normalization of URIs.

You can find more information about this vulnerability in the GitHub Security Advisory GHSA-vjv5-gp2w-65vm at https://github.com/eclipse/jetty.project/security/advisories/GHSA-vjv5-gp2w-65vm.

Related vulnerabilities

Recent vulnerabilities recorded for org.eclipse.jetty:jetty-webapp.

How To Fix

Fixed versions by release line

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

  • >= 9.4.37, < 9.4.43 9.4.43
  • >= 10.0.1, < 10.0.6 10.0.6
  • >= 11.0.1, < 11.0.6 11.0.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