A vulnerability in TensorFlow and Keras allows arbitrary code execution when deserializing Keras models from YAML format. The issue arises from the use of yaml.unsafe_load in the model deserialization process, which can execute arbitrary code embedded in the YAML input. This affects TensorFlow versions prior to 2.6.0, as well as 2.5.1, 2.4.3, and 2.3.4.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a working exploit for CVE-2021-37678, a deserialization vulnerability in TensorFlow 2.2.3's model loading via YAML. The exploit demonstrates how a malicious YAML model file can trigger arbitrary code execution when loaded using Keras' model_from_yaml function. The repository includes: - Dockerfile and docker-compose.yml to set up a vulnerable environment (TensorFlow 2.2.3, Python 3.6.9, PyYAML 3.12). - src/CreateExampleModel.py: Generates a benign model and serializes it to YAML. - src/ExploitTensorflowDeserialization.py: Loads a YAML model file, triggering the vulnerability. - src/printPasswdFile.yaml: Malicious payload to read /etc/passwd. - src/reverseShell.yaml: Malicious payload to spawn a reverse shell to a configurable IP/port (default 192.168.0.27:10000). - src/model_config.py: A patched version of TensorFlow's model_config.py, switching from unsafe_load to safe_load as a mitigation. - src/ExecutePythonScripts.sh: Orchestrates the demonstration, including exploitation and mitigation. The exploit is operational and demonstrates both file read and reverse shell payloads. The only network endpoint is the attacker's IP/port for the reverse shell, which must be set in reverseShell.yaml. The exploit is not part of a framework and is self-contained for demonstration and testing purposes.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
No public activity tracked yet. Mallory keeps watching.
No public activity observed for this vulnerability.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.