MODERATE 5.3

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)

ArtifactAffected versionsFixed 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

1affected artifacts
362affected versions
21,407dependent artifacts (est.)
1,236,880dependent versions

60% of the dependent artifacts (12,856) still pull an affected version in their latest release.

DepthDependent 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

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.