huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS)
40
CVE Score
Medium
Regular Expression Denial of Service (ReDoS)
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.
Upgrade the huggingface-hub library to the patch version.
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.
0.0.1 - 1.24.0
Fixed in 1.25.0huggingface-hub is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.0.1 - 1.24.0.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.