Intel

AIKIDO-2026-172897

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

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 29, 2026
July 29, 2026

40

CVE Score

Medium

Regular Expression Denial of Service (ReDoS)

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.

How do I fix this?

Upgrade the huggingface-hub library to the patch version.

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.

Versions

0.0.1 - 1.24.0

Fixed in 1.25.0

Background info

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

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea