{"id":"CVE-2025-6921","state":"PUBLISHED","title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","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.","publishedAt":"2025-09-23T13:56:15.636Z","updatedAt":"2025-09-23T14:56:29.038Z","severity":{"score":5.3,"label":"Medium","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","source":"@huntr_ai"},"assigner":"@huntr_ai","products":["huggingface huggingface/transformers"],"affected":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"4.53.0","versionType":"custom"}]}],"references":["https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f","https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be"],"weaknesses":["CWE-400"],"ingestedAt":"2026-10-29T20:10:04.440Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/6xxx/CVE-2025-6921.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2025-6921","state":"PUBLISHED","datePublished":"2025-09-23T13:56:15.636Z","dateUpdated":"2025-09-23T14:56:29.038Z","assignerShortName":"@huntr_ai","assignerOrgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateReserved":"2025-06-30T09:44:12.092Z"},"containers":{"cna":{"title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"4.53.0","versionType":"custom"}]}],"references":[{"url":"https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f"},{"url":"https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be"}],"metrics":[{"cvssV3_0":{"version":"3.0","attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"LOW","confidentialityImpact":"NONE","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","baseScore":5.3,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-400","type":"CWE","lang":"en","description":"CWE-400 Uncontrolled Resource Consumption"}]}],"providerMetadata":{"shortName":"@huntr_ai","orgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateUpdated":"2025-09-23T13:56:15.636Z"},"source":{"advisory":"287d15a7-6e7c-45d2-8c05-11e305776f1f","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2025-09-23T14:56:14.042617Z","id":"CVE-2025-6921","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-09-23T14:56:29.038Z"}}]}}}