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.
Originally disclosed on GitHub Security Lab
pydal contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service).
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
- Compile the vulnerable regular expression in a Python script.
- Run the script with python3 against a crafted string containing a CLOB value.
- 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.