Skip to content
DoS Advisory Intermediate

GHSL-2021-116: ReDoS (Regular Expression Denial of Service) in pydal

pydal contained an inefficient regular expression used to parse Oracle CLOB/BLOB values, which could take an extremely long time on a crafted input string. An attacker able to supply such a string could cause a denial of service by tying up the process.

kevinbackhouse Follow

Originally disclosed on GitHub Security Lab

pydal contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service).

kevinbackhouse, 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

Likely the regular expression uses nested repetition over overlapping character classes, causing catastrophic backtracking on crafted input.

Impact

This issue may lead to a denial of service.

What the attacker needed

Attacker can supply a crafted string to the regex

The fix

It was fixed in a commit after the reporter suggested a fix.

How it was found

  1. Compile the vulnerable regular expression in a Python script.
  2. Run the script with python3 against a crafted string containing a CLOB value.
  3. Observe that the match call does not terminate.

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 search text. Some patterns can be written so that certain inputs make the matching take a very long time, effectively freezing the program. Here, a specially crafted string could make pydal hang, which is a denial of service.

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 kevinbackhouse

View all

47 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.