Intel

AIKIDO-2026-172897

huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS)

Regular Expression Denial of Service (ReDoS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 5 days ago

40

Medium Risk

This Affects:

PYTHONhuggingface-hub
0.0.1 - 1.24.0
Fixed in 1.25.0
Are you affected? Scan for Free

TL;DR

REGEX_YAML_BLOCK in RepoCard matches YAML frontmatter with unbounded [\r\n]+ runs on both fences around a lazy [\S\s]*? body. On untrusted card content that opens with --- and then a long run of newlines without a valid closing fence, re.search catastrophically backtracks and can pin a CPU core for seconds to minutes. The fix replaces those unbounded newline classes with single line-ending alternatives so matching fails quickly on adversarial input.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you parse or render repository cards (RepoCard / model or dataset cards) that include YAML frontmatter from untrusted sources.

Background info

huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.0.1 - 1.24.0.

How to fix this

Upgrade the huggingface-hub library to the patch version.