{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2025-6921","id":"CVE-2025-6921","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 back","descriptionLong":"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-23T13:56:15.636Z","updated":"2026-10-28T02:30:25.931791389Z","reserved":"2025-06-30T09:44:12.092Z","status":"Analyzed","rejected":false,"assigner":"@huntr_ai","metric":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"high","source":"NVD"},"metrics":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"high","source":"NVD"},{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"@huntr_ai"},{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"huntr.dev"},{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"OSV"},{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"GitHub"}],"rating":"high","products":["huggingface/transformers"],"affectedProducts":[{"vendor":"huggingface","product":"huggingface/transformers","defaultStatus":null,"versions":[{"version":"unspecified","lessThan":"4.53.0","status":"affected","versionType":"custom"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<4.53.0"],"fixed":["4.53.0"],"advisory":"GHSA-4w7r-h757-3r74"}],"cwes":["CWE-400"],"aliases":["GHSA-4w7r-h757-3r74","PYSEC-2026-1980"],"references":[{"url":"https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f","tags":["Exploit","Third Party Advisory","web"]},{"url":"https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be","tags":["Patch","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/6xxx/CVE-2025-6921.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-6921","tags":["advisory"]},{"url":"https://github.com/huggingface/transformers/commit/d37f7517972f67e3f2194c000ed0f87f064e5099","tags":["web"]},{"url":"https://github.com/huggingface/transformers","tags":["package"]},{"url":"https://pypi.org/project/transformers","tags":["package"]},{"url":"https://github.com/advisories/GHSA-4w7r-h757-3r74","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial"},"epss":0.00511,"epssPercentile":0.44332,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2025-6921","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-6921","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2025-6921","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-4w7r-h757-3r74","ok":true,"note":"GHSA-4w7r-h757-3r74"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2025-6921","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}