Vulnerabilities in pkg:pypi/flash_attn
PACKAGECVE-2026-31253 is a HIGH (CVSS 7.3) flash-attention contains an insecure deserialization vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Flash attn libraries in the PyPI ecosystem. The issue involves flash-attention contains an insecure deserialization vulnerability in its checkpoint loading mechanism. Remediation is available in the latest vendor maintenance releases.
pkg:pypi/flash_attn
Vulnerability advisories affecting package pkg:pypi/flash_attn. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7g5w-pq96-8c5w | CVE-2026-31253 | HIGH | flash-attention contains an insecure deserialization vulnerability in its checkpoint loading mechanism |
CVE-2026-31253 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2026-31253
To remediate this vulnerability, upgrade all affected Flash attn dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install flash_attn>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show flash_attn
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-31253, inspect your installed packages using pip:
pip show flash_attn
Analyze the terminal output to locate any version of Flash attn in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show flash_attn command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Flash attn, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-31253 Affected Flash attn Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
flash_attn
|
PyPI |
≤ 2.8.3
|
|
References
Frequently Asked Questions
What is CVE-2026-31253?
Which Flash attn versions are affected?
What version fixes CVE-2026-31253?
Is flash_attn affected?
What is the CVSS score of CVE-2026-31253?
What CWE is associated with CVE-2026-31253?
How can I check PyPI dependencies for CVE-2026-31253?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7g5w-pq96-8c5w",
"modified" : "2026-05-18T15:22:20Z",
"published" : "2026-05-11T18:31:44Z",
"aliases" : [ "CVE-2026-31253" ],
"summary" : "flash-attention contains an insecure deserialization vulnerability in its checkpoint loading mechanism",
"details" : "The flash-attention training framework thru commit e724e2588cbe754beb97cf7c011b5e7e34119e62 (2025-13-04) contains an insecure deserialization vulnerability (CWE-502) in its checkpoint loading mechanism. The load_checkpoint() function in checkpoint.py and the checkpoint loading code in eval.py use torch.load() without enabling the security-restrictive weights_only=True parameter. This allows the deserialization of arbitrary Python objects via the pickle module. An attacker can exploit this by providing a maliciously crafted checkpoint file. When a victim loads this checkpoint during model warmstarting or evaluation, arbitrary code is executed on the victim's system.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "flash_attn"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "2.8.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-31253"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Dao-AILab/flash-attention"
}, {
"type" : "WEB",
"url" : "https://www.notion.so/CVE-2026-31253-35d1e1393188813f9e77e2038104bc49"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-18T15:22:20Z",
"nvd_published_at" : "2026-05-11T17:16:20Z"
}
}