Skip to content
DoS Advisory Intermediate CVE-2022-29158

GHSL-2022-025: Regular Expression Denial of Service (ReDoS) in Apache OFBiz - CVE-2022-29158

Apache OFBiz used a regular expression with nested repetitions to extract URLs from user-supplied parameters, which could cause catastrophic backtracking. An unauthenticated attacker could send a crafted URL parameter to trigger exponential processing time and deny service.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

Apache OFBiz up to version 18.12.05 is vulnerable to Regular Expression Denial of Service (ReDoS) in the way it handles URLs provided by external, unauthenticated users. Specially crafted URLs may cause catastrophic backtracking, taking exponential time to complete.

ghsecuritylab, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The regular expression used in UtilHttp.extractUrls contains nested repetitions that allow catastrophic backtracking on crafted input.

Impact

This issue may lead to a denial of service of the application server by resource consumption, but only when Apache OFBiz is run with JDK 8 or earlier because JDK 9 introduced mitigations.

What the attacker needed

Apache OFBiz running on JDK 8 or earlier; No authentication required

The fix

The issue was fixed in version 18.12.06.

How it was found

  1. Send an HTTP request to the partymgr/control/main endpoint with a parameter that looks like a URL but does not contain :// at index 3 or 4.
  2. Ensure the parameter value contains a long sequence of path segments that triggers the vulnerable regex.
  3. The server processes the parameter through canonicalizeParameterMap and then extractUrls, causing exponential backtracking and denial of service.

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 report has not been written yet. The Original tab links to the source.

A regular expression is a pattern used to match text. Some patterns can take a very long time to fail on certain inputs, which is called catastrophic backtracking. Here, an attacker could send a specially crafted web request that makes the server spend a huge amount of time checking the pattern, effectively freezing the application.

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 by ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

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.