{"id":"CVE-2025-6921","published":"2025-09-23T13:56:15Z","modified":"2025-09-23T14:56:29Z","title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00511,"percentile":0.44475,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"references":[{"url":"https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be","tags":[]}],"priority":{"score":12.6,"factors":[{"name":"EPSS percentile","points":8.89},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < 4.53.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-09-23T14:56:14.042617Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<4.53.0"],"patched":["4.53.0"],"from":["GHSA-4w7r-h757-3r74","PYSEC-2026-1980"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-30889","exploited":false,"provenance":"source"}}