CVE-2026-31253: Flash attn Flash-attention Contains An Insecure Deserialization Vulnerability

HIGH
Advisory Identifier: GHSA-7g5w-pq96-8c5w
CVSS 7.3
CWE-502 CWE-94
Published
Advisory Summary

CVE-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.

CVE-2026-31253 at a Glance

CVE Identifier CVE-2026-31253
GHSA Identifier GHSA-7g5w-pq96-8c5w
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Flash attn
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (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.

flash_attn fixed: Latest secure release
pip install flash_attn>=Latest secure release
Verify Direct and Transitive Dependencies

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

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.

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?
CVE-2026-31253 is a security vulnerability in Flash attn involving flash-attention contains an insecure deserialization vulnerability in its checkpoint loading mechanism under CWE-502: Deserialization of Untrusted Data.
Which Flash attn versions are affected?
Affected versions include releases prior to current release patches across affected packages: flash_attn.
What version fixes CVE-2026-31253?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is flash_attn affected?
Yes, flash_attn is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-31253?
CVE-2026-31253 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2026-31253?
CVE-2026-31253 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2026-31253?
Run the dependency tree command: 'pip show flash_attn'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}