transformers vulnerabilities

Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

Registry
PyPI
Latest
5.23.0
License
Apache 2.0 License

32 known advisories

The latest version, 5.23.0, is not affected by any of them. Projects on older versions may be.

Update to the latest version:pip install 'transformers>=5.23.0'

Is your project on an affected transformers?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for transformers

  • HighCVE-2026-80047GHSA-x9r9-c232-4q391 Sept 2026

    Hugging Face Transformers downloads custom generation code before trust consent

    Affected
    >=4.49.0 <=5.8.1
    Fixed in
    No fix released
  • HighCVE-2026-9856GHSA-xrqw-3rrv-vx5w2 Aug 2026

    Transformers save_pretrained path traversal allows arbitrary file writes through chat template names

    Affected
    <5.10.0
    Fixed in
    5.10.0
  • HighCVE-2026-5241GHSA-fgcw-684q-jj6r3 Jun 2026

    huggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Path

    Affected
    <5.5.0
    Fixed in
    5.5.0
  • HighCVE-2026-4372GHSA-29pf-2h5f-8g7226 May 2026

    HuggingFace transformers vulnerable to remote code execution

    Affected
    <5.3.0
    Fixed in
    5.3.0
  • MediumCVE-2026-1839GHSA-69w3-r845-38557 Apr 2026

    HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class

    Affected
    <5.0.0rc3
    Fixed in
    5.0.0rc3
  • LowCVE-2025-14930PYSEC-2025-21823 Dec 2025

    No summary published

    Affected
    <=4.57.1
    Fixed in
    No fix released
  • LowCVE-2025-14929PYSEC-2025-21723 Dec 2025

    No summary published

    Affected
    <=5.0.0-rc0
    Fixed in
    No fix released
  • LowCVE-2025-14928PYSEC-2025-21623 Dec 2025

    No summary published

    Affected
    <=4.57.0
    Fixed in
    No fix released
  • LowCVE-2025-14927PYSEC-2025-21523 Dec 2025

    No summary published

    Affected
    <=4.57.0
    Fixed in
    No fix released
  • LowCVE-2025-14926PYSEC-2025-21423 Dec 2025

    No summary published

    Affected
    <=4.57.0
    Fixed in
    No fix released
  • LowCVE-2025-14924PYSEC-2025-21323 Dec 2025

    No summary published

    Affected
    <=4.55.0
    Fixed in
    No fix released
  • LowCVE-2025-14921PYSEC-2025-21223 Dec 2025

    No summary published

    Affected
    <=4.54.1
    Fixed in
    No fix released
  • LowCVE-2025-14920PYSEC-2025-21123 Dec 2025

    No summary published

    Affected
    <=4.54.1
    Fixed in
    No fix released
  • MediumCVE-2025-6921GHSA-4w7r-h757-3r7423 Sept 2025

    Hugging Face Transformers vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer

    Affected
    <4.53.0
    Fixed in
    4.53.0
  • MediumCVE-2025-6051GHSA-rcv9-qm8p-9p6j14 Sept 2025

    Hugging Face Transformers library has Regular Expression Denial of Service

    Affected
    <4.53.0
    Fixed in
    4.53.0
  • MediumCVE-2025-6638GHSA-59p9-h35m-wg4g12 Sept 2025

    Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer

    Affected
    <4.53.0
    Fixed in
    4.53.0
  • MediumCVE-2025-5197GHSA-9356-575x-2w9m6 Aug 2025

    Hugging Face Transformers Regular Expression Denial of Service (ReDoS) vulnerability

    Affected
    <4.53.0
    Fixed in
    4.53.0
  • MediumCVE-2025-3933GHSA-37mw-44qp-f5jm11 Jul 2025

    Transformers is vulnerable to ReDoS attack through its DonutProcessor class

    Affected
    <4.52.1
    Fixed in
    4.52.1
  • MediumCVE-2025-3262GHSA-489j-g2vx-39wf7 Jul 2025

    Transformers vulnerable to ReDoS attack through its SETTING_RE variable

    Affected
    >=4.49.0 <4.51.0
    Fixed in
    4.51.0
  • MediumCVE-2025-3264GHSA-jjph-296x-mrcr7 Jul 2025

    Transformers vulnerable to ReDoS attack through its get_imports() function

    Affected
    <4.51.0
    Fixed in
    4.51.0
  • MediumCVE-2025-3263GHSA-q2wp-rjmx-x6x97 Jul 2025

    Transformers's ReDoS vulnerability in get_configuration_file can lead to catastrophic backtracking

    Affected
    <4.51.0
    Fixed in
    4.51.0
  • LowCVE-2025-3777GHSA-phhr-52qp-3mj47 Jul 2025

    Transformers's Improper Input Validation vulnerability can be exploited through username injection

    Affected
    <4.52.1
    Fixed in
    4.52.1
  • MediumCVE-2025-2099GHSA-qq3j-4f4f-958319 May 2025

    Hugging Face Transformers Regular Expression Denial of Service

    Affected
    <4.50.0
    Fixed in
    4.50.0
  • MediumCVE-2025-1194GHSA-fpwr-67px-3qhx29 Apr 2025

    Transformers Regular Expression Denial of Service (ReDoS) vulnerability

    Affected
    <4.50.0
    Fixed in
    4.50.0
  • MediumCVE-2024-12720GHSA-6rvg-6v2m-4j4620 Mar 2025

    Transformers Regular Expression Denial of Service (ReDoS) vulnerability

    Affected
    <4.48.0
    Fixed in
    4.48.0
  • HighCVE-2024-11394GHSA-hxxf-235m-72v323 Nov 2024

    Deserialization of Untrusted Data in Hugging Face Transformers

    Affected
    <4.48.0
    Fixed in
    4.48.0
  • HighCVE-2024-11392GHSA-qxrp-vhvm-j76523 Nov 2024

    Deserialization of Untrusted Data in Hugging Face Transformers

    Affected
    <4.48.0
    Fixed in
    4.48.0
  • HighCVE-2024-11393GHSA-wrfc-pvp9-mr9g23 Nov 2024

    Deserialization of Untrusted Data in Hugging Face Transformers

    Affected
    <4.48.0
    Fixed in
    4.48.0
  • LowCVE-2024-3568GHSA-37q5-v5qm-c9v810 Apr 2024

    Transformers Deserialization of Untrusted Data vulnerability

    Affected
    <4.38.0
    Fixed in
    4.38.0
  • HighCVE-2023-7018GHSA-v68g-wm8c-6x7j20 Dec 2023

    transformers has a Deserialization of Untrusted Data vulnerability

    Affected
    <4.36.0
    Fixed in
    4.36.0
  • CriticalCVE-2023-6730GHSA-3863-2447-669p19 Dec 2023

    transformers has a Deserialization of Untrusted Data vulnerability

    Affected
    <4.36.0
    Fixed in
    4.36.0
  • MediumCVE-2023-2800GHSA-282v-666c-3fvg18 May 2023

    transformers has Insecure Temporary File

    Affected
    <4.30.0
    Fixed in
    4.30.0

Is your transformers version vulnerable?

Which of your client projects still run an old transformers?

NPMscan reads the requirements.txt, poetry.lock, uv.lock and Pipfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other PyPI packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the PyPI registry.