Transformers Regular Expression Denial of Service (ReDoS) vulnerability
A regular expression in the GPT-NeoX-Japanese tokenizer has exponential complexity, causing excessive backtracking when processing specially crafted inputs. An attacker could supply such input to cause high CPU usage and potential application downtime, resulting in a denial of service.
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_gpt_neox_japanese.py of the GPT-NeoX-Japanese model. The vulnerability occurs in the SubWordJapaneseTokenizer class, where regular expressions process specially crafted inputs. The issue stems from a regex exhibiting exponential complexity under certain conditions, leading to excessive backtracking. This can result in high CPU usage and potential application downtime, effectively creating a Denial of Service (DoS) scenario. The affected version is v4.48.1 (latest).
From the GitHub Advisory Database (GHSA-fpwr-67px-3qhx, 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 high CPU usage and potential application downtime, effectively 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 to process certain inputs, especially if they backtrack (try many combinations). Here, a specially crafted input makes the tokenizer's regex work extremely hard, using lots of CPU and possibly making the application unresponsive.
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.