Skip to content
DoS Disclosed report Intermediate CVE-2024-12720

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

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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.

More from huggingface/transformers

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.