Skip to content
HighVulnerability

CVE-2025-12058: Keras load_model arbitrary local file read and SSRF via StringLookup vocabulary

Identifier
CVE-2025-12058
Published
Record updated
View JSON
Affected
  • keras < 3.12.0
Fixed in
3.12.0
  • released October 27, 2025, 2 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

CVE-2025-12058 affects the Keras.Model.load_model method, including when called with safe_mode=True. Loading a specially crafted .keras archive with a malicious vocabulary path in the StringLookup layer's configuration lets an attacker read arbitrary local files, retrievable via get_vocabulary(). Because Keras uses tf.io.gfile, which supports remote filesystems and HTTP/HTTPS, the same path can also trigger server-side requests to arbitrary network endpoints. The safe_mode=True flag did not restrict this external path loading.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.