{"id":"CVE-2025-6921","url":"https://www.cyber-defence.io/tools/cve/CVE-2025-6921","generatedAt":"2026-10-27T23:08:10.455Z","title":"The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer.","description":"The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. The vulnerability arises from the _do_use_weight_decay method, which processes user-controlled regular expressions in the include_in_weight_decay and exclude_from_weight_decay lists. Malicious regular expressions can cause catastrophic backtracking during the re.search call, leading to 100% CPU utilization and a denial of service. This issue can be exploited by attackers who can control the patterns in these lists, potentially causing the machine learning task to hang and rendering services unresponsive.","published":"2025-09-23T14:15:41.000Z","lastModified":"2026-10-11T20:10:00.000Z","status":"Analyzed","sourceIdentifier":"security@huntr.dev","cvss":{"version":"3.1","score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-400"],"affected":["huggingface/transformers"],"epss":{"score":0.00511,"percentile":0.43296,"date":"2026-10-26","history":[]},"kev":{"listed":false},"exploits":{"count":0,"verified":false,"firstPublished":null,"source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[]},"verdict":{"level":"high","text":"High impact if exploited, but EPSS currently rates exploitation as unlikely (0.51%). Schedule it in the normal patch cycle and watch for a rise in EPSS or a public exploit."},"changes":[],"references":[{"url":"https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be","tags":["Patch"],"source":"security@huntr.dev"},{"url":"https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f","tags":["Exploit","Third Party Advisory"],"source":"security@huntr.dev"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-6921","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}