Transformers Regular Expression Denial of Service (ReDoS) vulnerability
A regular expression in the Nougat tokenizer's post-processing function has exponential time complexity, so specially crafted input causes excessive backtracking. An attacker could trigger high CPU usage and potentially take the application down.
huggingface/transformers
Originally disclosed on huntr
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file tokenization_nougat_fast.py. The vulnerability occurs in the post_process_single() function, where a regular expression processes specially crafted input. The issue stems from the regex exhibiting exponential time complexity under certain conditions, leading to excessive backtracking. This can result in significantly high CPU usage and potential application downtime, effectively creating a Denial of Service (DoS) scenario. The affected version is v4.46.3.
From the GitHub Advisory Database (GHSA-6rvg-6v2m-4j46, CC BY 4.0).
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
Impact
An attacker could cause significantly high CPU usage and potential application downtime, creating a denial of service.
What the attacker needed
Ability to supply input to the tokenizer
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 on certain inputs because the computer tries many combinations. Here, a crafted input makes the pattern work exponentially harder, using lots of CPU and possibly making the application unavailable.
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.