CVE-2023-6730: Deserialization of Untrusted Data in transformers
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.