CVE-2023-6730: Deserialization of Untrusted Data in transformers

transformers Updated 02 Oct 2025

Summary

19/12/2023
Yes i
Critical
9.0

CVE-2023-6730: transformers has a Deserialization of Untrusted Data vulnerability. Affects transformers versions < 4.36.0. Fixed in 4.36.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The transformers package is a popular Python library used for natural language processing tasks, such as text generation, translation, and sentiment analysis. It provides a wide range of pre-trained models and utilities for working with transformer-based architectures. Unfortunately, prior to version 4.36.0, transformers is vulnerable to a Deserialization of Untrusted Data vulnerability.

Vulnerability Detail

The Deserialization of Untrusted Data vulnerability in transformers allows an attacker to execute arbitrary code by manipulating serialized data. This can lead to remote code execution, privilege escalation, or other malicious activities. The vulnerability specifically affects the 'transformers.models.rag.retrieval_rag' function. It is critical in severity, with a CVSS score of 9.0.

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.36.0

This is the first release that contains the fix.

pip install --upgrade "transformers==4.36.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the latest version of the transformers package to ensure the security of your application.

Conclusion

The Deserialization of Untrusted Data vulnerability in transformers can have severe consequences, including remote code execution and privilege escalation. It is crucial to update the transformers package to version 4.36.0 or later to mitigate this vulnerability. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for transformers →

Share this vulnerability

FAQ

The vulnerability allows an attacker to execute arbitrary code, potentially leading to remote code execution, privilege escalation, or other malicious activities.

The vulnerability affects all versions of transformers prior to 4.36.0.

Yes, the vulnerability can be fixed by updating the transformers package to version 4.36.0 or later.

No, there are no known workarounds for this vulnerability. Updating to the latest version is the recommended solution.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It analyzes your Pipfile.lock and provides real-time alerts for open-source vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for transformers.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.36.0

This is the first release that contains the fix.

pip install --upgrade "transformers==4.36.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback