CVE-2026-31253
Insecure Deserialization in Flash-Attention Training Framework
Publication date: 2026-05-11
Last updated on: 2026-05-11
Assigner: MITRE
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| dao_ailab | flashattention | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the flash-attention training framework's checkpoint loading mechanism. Specifically, the load_checkpoint() function and related code use torch.load() without enabling the security-restrictive weights_only=True parameter. This means that when loading a checkpoint file, the system deserializes Python objects using the pickle module without restrictions.
Because of this insecure deserialization (CWE-502), an attacker can craft a malicious checkpoint file that, when loaded by a victim, executes arbitrary code on the victim's system. This can happen during model warmstarting or evaluation phases.
How can this vulnerability impact me? :
The impact of this vulnerability is that an attacker can execute arbitrary code on your system by tricking you into loading a malicious checkpoint file. This can lead to unauthorized actions such as data theft, system compromise, or further malware installation.
Since the vulnerability occurs during model checkpoint loading, any environment that uses the flash-attention framework for training or evaluation and loads untrusted checkpoint files is at risk.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves insecure deserialization in the flash-attention training framework's checkpoint loading mechanism, specifically when loading checkpoint files using torch.load() without the weights_only=True parameter.
To detect this vulnerability on your system, you can check if the flash-attention framework version you are using includes the insecure checkpoint loading code. This can be done by inspecting the source code or the version commit (e724e2588cbe754beb97cf7c011b5e7e34119e62 or later).
You can also scan your system for checkpoint files that might be loaded insecurely. Since the vulnerability is triggered by loading malicious checkpoint files, monitoring or auditing the usage of torch.load() in your environment, especially calls without weights_only=True, can help.
Suggested commands include:
- Use grep or similar tools to find usage of torch.load() without weights_only=True in your codebase: grep -r "torch.load(" ./
- Check the version or commit of flash-attention installed: git log -1 or pip show flashattention
- Monitor or audit checkpoint files being loaded, for example by tracing file access or hooking into the load_checkpoint() function.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, immediately ensure that the checkpoint loading code uses torch.load() with the security-restrictive parameter weights_only=True enabled.
Avoid loading checkpoint files from untrusted or unauthenticated sources, as maliciously crafted checkpoint files can execute arbitrary code.
If possible, update the flash-attention framework to a version that fixes this vulnerability by enforcing secure deserialization practices.
As a temporary measure, audit and restrict access to checkpoint files and monitor their usage to prevent exploitation.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability allows arbitrary code execution via insecure deserialization when loading malicious checkpoint files. This could lead to unauthorized access or manipulation of data on the victim's system.
Such unauthorized access or execution could potentially result in breaches of data confidentiality and integrity, which are critical requirements under standards like GDPR and HIPAA.
Therefore, exploitation of this vulnerability may cause non-compliance with these regulations due to failure to adequately protect sensitive data and systems from malicious code execution.