huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS)
40
Medium Risk
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.
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.
huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.0.1 - 1.24.0.
Upgrade the huggingface-hub library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant