CVE-2026-31253 flash-attention contains an insecure deserialization vulnerability in its checkpoint loading mechanism

High 7.3 Published Updated

An attacker can execute arbitrary code by tricking a user into loading a malicious checkpoint file in the flash-attention training framework.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-31253?

CVE-2026-31253 is a high-severity unsafe deserialization vulnerability in n/a, published on 11 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-94, CWE-502

Which versions are affected by CVE-2026-31253?

3 open source packages ship an affected version, including flash-attn and flash_attn.

PackageAffectedFixed in
flash-attn PyPIAll versions to 2.8.3None
flash-attn PyPIAll versions to 2.8.3None
flash_attn PyPIAll versions to 2.8.3None

How do I fix CVE-2026-31253?

No fix has been published for CVE-2026-31253 yet. Limit exposure of the affected software until one is available.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2026-31253 being exploited?

There is no known exploitation of CVE-2026-31253 in the wild and no public exploit code.

Sources

Also known as GHSA-7g5w-pq96-8c5w, PYSEC-2026-2477.

Is CVE-2026-31253 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free