{
  "id": "CVE-2025-2099",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-2099",
  "published_at": "2025-05-19T11:22:36.908Z",
  "title": "Regular Expression Denial of Service (ReDoS) in huggingface/transformers",
  "vendor": "huggingface",
  "product": "huggingface/transformers",
  "cvss": {
    "score": 7.5,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` module in huggingface/transformers version v4.48.3 allows for a Regular Expression Denial of Service (ReDoS) attack. The regular expression used to process code blocks in docstrings contains nested quantifiers, leading to exponential backtracking when processing input with a large number of newline characters. An attacker can exploit this by providing a specially crafted payload, causing high CPU usage and potential application downtime, effectively resulting in a Denial of Service (DoS) scenario.",
  "cwe": "CWE-1333",
  "cpes": [
    "cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 5.3,
    "nvd": 7.5
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "huggingface",
        "product": "huggingface/transformers",
        "ranges": [
          "\u003e= unspecified, \u003c 4.50.0"
        ],
        "fixed_in": [
          "4.50.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade huggingface/transformers to 4.50.0 or later."
    ],
    "references": [
      {
        "kind": "Patch",
        "url": "https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
