CVE-2023-26048
OutOfMemoryError for large multipart without filename in Eclipse Jetty
Description
Impact
Servlets with multipart support (e.g. annotated with @MultipartConfig) that call HttpServletRequest.getParameter() or HttpServletRequest.getParts() may cause OutOfMemoryError when the client sends a multipart request with a part that has a name but no filename and a very large content.
This happens even with the default settings of fileSizeThreshold=0 which should stream the whole part content to disk.
An attacker client may send a large multipart request and cause the server to throw OutOfMemoryError.
However, the server may be able to recover after the OutOfMemoryError and continue its service -- although it may take some time.
A very large number of parts may cause the same problem.
Patches
Patched in Jetty versions
- 9.4.51.v20230217 - via PR #9345
- 10.0.14 - via PR #9344
- 11.0.14 - via PR #9344
Workarounds
Multipart parameter maxRequestSize must be set to a non-negative value, so the whole multipart content is limited (although still read into memory).
Limiting multipart parameter maxFileSize won't be enough because an attacker can send a large number of parts that summed up will cause memory issues.
References
- https://github.com/eclipse/jetty.project/issues/9076
- https://github.com/jakartaee/servlet/blob/6.0.0/spec/src/main/asciidoc/servlet-spec-body.adoc#32-file-upload
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.eclipse.jetty » jetty-server | < 9.4.51.v20230217>= 10.0.0, < 10.0.14>= 11.0.0, < 11.0.14 | 9.4.51.v20230217, 10.0.14, 11.0.14 |
Blast radius
60% of the dependent artifacts (12,856) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 135,077 |
| 2 hops | 374,888 |
| 3 hops | 337,903 |
| 4 hops | 181,410 |
| 5 hops | 135,977 |
| 6 hops | 71,625 |
Most used dependents
- org.apache.maven.plugins » maven-site-plugin9,107 usages
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.kafka » kafka-clients3,135 usages
- org.eclipse.jetty » jetty-servlet2,979 usages
- org.apache.spark » spark-core2,899 usages
- org.eclipse.jetty » jetty-webapp2,060 usages
- com.github.tomakehurst » wiremock1,838 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.apache.kafka » kafka1,450 usages
- org.jenkins-ci.tools » maven-hpi-plugin1,404 usages
- org.apache.hadoop » hadoop-hdfs1,377 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- org.eclipse.jetty » jetty-maven-plugin1,337 usages
- org.liquibase » liquibase-core1,306 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/eclipse/jetty.project/security/advisories/GHSA-qw69-rqj8-6qw8
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2023-26048
- Webhttps://github.com/eclipse/jetty.project/issues/9076
- Webhttps://github.com/eclipse/jetty.project/pull/9344
- Webhttps://github.com/eclipse/jetty.project/pull/9345
- Packagehttps://github.com/eclipse/jetty.project
- Webhttps://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.51.v20230217
- Webhttps://github.com/jakartaee/servlet/blob/6.0.0/spec/src/main/asciidoc/servlet-spec-body.adoc#32-file-upload
- Webhttps://lists.debian.org/debian-lts-announce/2023/09/msg00039.html
- Webhttps://security.netapp.com/advisory/ntap-20230526-0001
- Webhttps://www.debian.org/security/2023/dsa-5507
