Skip to content
DoS Write-up Intermediate

A common defect in java system-Memory DoS (include CVE-2021-2344, CVE-2021-2371, CVE-2021-2376, CVE-2021-2378)

The author found that many Java systems allow an attacker to control array or collection initialisation sizes during deserialisation or HTTP request handling, causing an OutOfMemoryError and a memory denial of service. This affected Java SE, WebLogic, Spring and Sentinel, with some issues fixed and others left unfixed.

threedr3am Follow

Published on threedr3am.github.io

DoS是Denial of Service的简称,即拒绝服务,造成DoS的攻击行为被称为DoS攻击,� �目的是使计算机或网络无法提供正常的服务。拒绝服务存在于各种网络服务上,这个网络服务可以是c、c++实现的,也可以是go、java、php、python等等语言实现。

threedr3am (@threedr3am1), on threedr3am.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could cause a memory denial of service, making the application unavailable; however, the duration of the denial depends on whether the allocated memory is referenced by a long-lived object, and some issues require specific preconditions.

What the attacker needed

Ability to send crafted input; vulnerable component in use; for Spring, a controller accepting byte[]

The fix

The issues were fixed in Java SE 8u301 and WebLogic (CVE-2021-2344, CVE-2021-2371, CVE-2021-2376, CVE-2021-2378), but Spring did not fix its issue, stating that other systems should impose limits.

How it was found

  1. Identify a Java system that deserialises untrusted data or accepts HTTP requests with size parameters.
  2. Find a class or endpoint where an array or collection is initialised with a user-controlled size.
  3. Set the size parameter to a very large value, such as the maximum integer minus two.
  4. Send the malicious data or request to the system.
  5. Observe that the JVM throws an OutOfMemoryError and the service becomes unavailable.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A denial-of-service attack makes a service unavailable to normal users. In Java, running out of memory causes an OutOfMemoryError, which can crash the application. The author found that if an attacker can set the size of an array or collection to a huge number, the program tries to allocate that much memory and fails.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Oracle

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.