Regular Expression Denial of Service (ReDoS) in huggingface/transformers
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2025-3262
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 05:30 UTC · Revision 1
Source evidence
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
core-osv · Original sourcePublished 7 Jul 2025, 09:54 UTC
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.
osv:CVE-2025-3262
Complete source record
{
"id": "bf6a69892a650b58c67ee1e919d0c12f74f7ab3c2882397aeb58505ac206c269",
"url": "https://osv.dev/vulnerability/CVE-2025-3262",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Regular Expression Denial of Service (ReDoS) in huggingface/transformers",
"summary": "A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.",
"evidence": "osv:CVE-2025-3262",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2025-3262",
"aliases": [
"CVE-2025-3262",
"GHSA-489j-g2vx-39wf",
"PYSEC-2026-1979"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/huggingface/transformers",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "0720e206c6ba28887e4d60ef60a6a089f6c1cc76"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "4.51.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "SplitRange"
},
{
"range": [
{
"fixed": "0720e206c6ba28887e4d60ef60a6a089f6c1cc76"
}
],
"source": "REFERENCES_COMMIT"
},
{
"cpe": "cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "4.51.0"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v4.50.3-DeepSeek-3",
"v4.49.0-Mistral-3",
"v4.49.0-AyaVision",
"v4.49.0-SigLIP-2",
"v4.49.0-SmolVLM-2",
"v4.33.1",
"v4.16.0",
"v4.15.0",
"v4.14.0",
"v4.13.0",
"v4.12.0",
"v4.11.0",
"v4.10.0",
"v4.9.0",
"v4.8.0",
"v4.7.0",
"v4.6.0",
"v4.5.0",
"v4.4.0",
"v4.3.0.rc1",
"4.3.0.rc1",
"v4.2.0",
"v4.1.1",
"v4.1.0",
"v3.5.0",
"v3.4.0",
"v3.3.1",
"v3.3.0",
"v3.2.0",
"v3.1.0",
"v3.0.2",
"v3.0.1",
"3.0.1",
"v3.0.0",
"v2.11.0",
"v2.10.0",
"v2.9.1",
"v2.9.0",
"v2.8.0",
"v2.7.0",
"v2.6.0",
"v2.5.1",
"v2.5.0",
"v2.4.1",
"v2.4.0",
"v2.3.0",
"v2.2.2",
"v2.2.1",
"v2.2.0",
"v2.1.1",
"v2.1.0",
"v2.0.0",
"1.2.0",
"1.1.0",
"1.0",
"v0.6.2",
"v0.6.1",
"v0.6.0",
"v0.5.1",
"v0.5.0",
"0.5.0",
"v0.4.0",
"v0.3.0",
"v0.2.0",
"v0.1.2",
"0.1.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-3262.json"
}
}
],
"modified": "2026-10-28T02:30:50.015453202Z",
"provider": "osv",
"references": [
"https://huntr.com/bounties/ecf5ccc4-39e7-4fb3-b547-14a41d31a184",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/3xxx/CVE-2025-3262.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-3262",
"https://github.com/huggingface/transformers/commit/0720e206c6ba28887e4d60ef60a6a089f6c1cc76"
],
"provider_metadata": {
"cwe_ids": [
"CWE-1333"
],
"cna_assigner": "@huntr_ai",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/3xxx/CVE-2025-3262.json"
}
},
"related_cves": [
{
"value": "CVE-2025-3262",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 518376,
"published_at": "2025-07-07T09:54:39.079+00:00"
}