Executive brief
Flash-attention is a library used to speed up the training and operation of large machine learning models. A security flaw in its training script allows the software to execute hidden commands embedded within configuration files. If an attacker can convince a user to run the training script with a malicious configuration file, they could gain full control over the system running the model, potentially leading to data theft or unauthorized access to computing resources.
Technical details
A code injection vulnerability (CWE-94) exists in the flash-attention training script through commit e724e2588cbe754beb97cf7c011b5e7e34119e62. The root cause is the registration of the Python 'eval()' function as a custom Hydra resolver named 'eval'. This configuration allows any string within a Hydra YAML configuration file using the '${eval:...}' syntax to be executed as arbitrary Python code. An attacker who can provide or modify a configuration file used by the training script can achieve arbitrary code execution in the context of the user running the script. This typically requires local access or social engineering to induce a user to load a malicious configuration.
Affected products
- flash-attention project flash-attention up to commit e724e2588cbe754beb97cf7c011b5e7e34119e62
Timeline
- 2026-05-11: advisory: CVE-2026-31254 published by NVD