{"id":"CVE-2025-12058","aliases":["AZL-69021","AZL-69583","DEBIAN-CVE-2025-12058","GHSA-mq84-hjqx-cwf2","GHSA-qg93-c7p6-gg7f","PYSEC-2026-1487","UBUNTU-CVE-2025-12058"],"summary":"Vulnerability in Keras Model.load_model Leading to Arbitrary Local File Loading and SSRF","published_at":"2025-10-29T08:48:29.689Z","modified_at":"2026-09-10T03:50:30.08821Z","products":[],"rating":{"severity":"medium","score":5.9,"vector":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L","attack_path":"adjacent","user_interaction":true,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Ubuntu","rating":"medium"},{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.0025400000158697367,"percentile":0.17103999853134155,"date":"2026-11-19T00:00:00Z"},"priority":5.4,"details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","affected_stack":[],"affected_other":[{"ecosystem":"Azure Linux:2","package":"keras","purl":"pkg:rpm/azure-linux/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.11.0-3"}]}],"provider":"osv","source":"AZL-69583","relation":"self"},{"ecosystem":"Azure Linux:3","package":"keras","purl":"pkg:rpm/azure-linux/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"3.3.3-6"}]}],"provider":"osv","source":"AZL-69021","relation":"self"},{"ecosystem":"CVE","package":"Keras/Keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"fixed":["3.12.0"],"provider":"cvelistv5","source":"CVE-2025-12058","relation":"self"},{"ecosystem":"Debian:11","package":"keras","purl":"pkg:deb/debian/keras?arch=source&distro=bullseye","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.1+dfsg-3","2.3.1+dfsg2-1"],"provider":"osv","source":"DEBIAN-CVE-2025-12058","relation":"self"},{"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"versions":["0.2.0","0.3.0","0.3.1","0.3.2","0.3.3","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.1.1","1.1.2","1.2.0","1.2.1","1.2.2","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.10.0","2.10.0rc0","2.10.0rc1","2.11.0","2.11.0rc0","2.11.0rc1","2.11.0rc2","2.11.0rc3","2.12.0","2.12.0rc0","2.12.0rc1","2.13.1","2.13.1rc0","2.13.1rc1","2.14.0","2.14.0rc0","2.15.0","2.15.0rc0","2.15.0rc1","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.4.3","2.5.0rc0","2.6.0","2.6.0rc0","2.6.0rc1","2.6.0rc2","2.6.0rc3","2.7.0","2.7.0rc0","2.7.0rc2","2.8.0","2.8.0rc0","2.8.0rc1","2.9.0","2.9.0rc0","2.9.0rc1","2.9.0rc2","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1.0","3.1.1","3.10.0","3.11.0","3.11.1","3.11.2","3.11.3","3.2.0","3.2.1","3.3.0","3.3.1","3.3.2","3.3.3","3.4.0","3.4.1","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","3.9.1","3.9.2"],"fixed":["3.12.0"],"provider":"osv","source":"GHSA-mq84-hjqx-cwf2","relation":"self"},{"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"versions":["0.2.0","0.3.0","0.3.1","0.3.2","0.3.3","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.1.1","1.1.2","1.2.0","1.2.1","1.2.2","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.10.0","2.10.0rc0","2.10.0rc1","2.11.0","2.11.0rc0","2.11.0rc1","2.11.0rc2","2.11.0rc3","2.12.0","2.12.0rc0","2.12.0rc1","2.13.1","2.13.1rc0","2.13.1rc1","2.14.0","2.14.0rc0","2.15.0","2.15.0rc0","2.15.0rc1","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.4.3","2.5.0rc0","2.6.0","2.6.0rc0","2.6.0rc1","2.6.0rc2","2.6.0rc3","2.7.0","2.7.0rc0","2.7.0rc2","2.8.0","2.8.0rc0","2.8.0rc1","2.9.0","2.9.0rc0","2.9.0rc1","2.9.0rc2","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1.0","3.1.1","3.10.0","3.11.0","3.11.1","3.11.2","3.11.3","3.2.0","3.2.1","3.3.0","3.3.1","3.3.2","3.3.3","3.4.0","3.4.1","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","3.9.1","3.9.2"],"fixed":["3.12.0"],"provider":"osv","source":"PYSEC-2026-1487","relation":"self"},{"ecosystem":"TuxCare:PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.0.post0"},{"fixed":"2.15.0.post5+tuxcare"}]}],"versions":["2.15.0","2.15.0.post1+tuxcare","2.15.0.post2+tuxcare","2.15.0.post3+tuxcare","2.15.0.post4+tuxcare"],"fixed":["2.15.0.post5+tuxcare"],"provider":"osv","source":"CLSA-2026-1794298440","relation":"upstream"},{"ecosystem":"Ubuntu:18.04:LTS","package":"keras","purl":"pkg:deb/ubuntu/keras@2.1.1-1?arch=source&distro=bionic","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.7-2","2.1.1-1"],"provider":"osv","source":"UBUNTU-CVE-2025-12058","relation":"self"},{"ecosystem":"Ubuntu:20.04:LTS","package":"keras","purl":"pkg:deb/ubuntu/keras@2.2.4-1?arch=source&distro=focal","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.4-1"],"provider":"osv","source":"UBUNTU-CVE-2025-12058","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9","rhoai/odh-modelmesh-runtime-adapter-rhel8","rhoai/odh-modelmesh-runtime-adapter-rhel9","rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9","rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9","rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9","rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9"],"package_count":10,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2025-12058"},{"vendor":"Red Hat","product":"Red Hat Trusted Artifact Signer","cpe":"cpe:/a:redhat:trusted_artifact_signer:1","status":"affected","packages":["rhtas/model-transparency-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2025-12058"}],"records":[{"provider":"osv","source_id":"CLSA-2026-1794298440","relation":"upstream","url":"https://osv.dev/vulnerability/CLSA-2026-1794298440","published_at":"2026-11-10T09:14:01Z","modified_at":"2026-11-17T13:31:19.829942Z","summary":"TuxCare security update for keras (4 CVEs)","details":"TuxCare rebuilt keras to address 4 CVEs. Fixed in 2.15.0.post5+tuxcare.","severity":[],"affected":[{"ecosystem":"TuxCare:PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.0.post0"},{"fixed":"2.15.0.post5+tuxcare"}]}],"versions":["2.15.0","2.15.0.post1+tuxcare","2.15.0.post2+tuxcare","2.15.0.post3+tuxcare","2.15.0.post4+tuxcare"],"fixed":["2.15.0.post5+tuxcare"],"provider":"osv","source":"CLSA-2026-1794298440","relation":"upstream"}],"product_status":[],"references":[]},{"provider":"cvelistv5","source_id":"CVE-2025-12058","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058","license":"CC-BY-4.0","published_at":"2025-10-29T08:48:29.689Z","modified_at":"2025-10-29T14:11:03.027Z","summary":"Vulnerability in Keras Model.load_model Leading to Arbitrary Local File Loading and SSRF","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L","source":"CVE-2025-12058"}],"affected":[{"ecosystem":"CVE","package":"Keras/Keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"fixed":["3.12.0"],"provider":"cvelistv5","source":"CVE-2025-12058","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"},{"type":"WEB","url":"https://github.com/keras-team/keras/pull/21751"}]},{"provider":"osv","source_id":"AZL-69021","relation":"self","url":"https://osv.dev/vulnerability/AZL-69021","license":"MIT","published_at":"2025-10-29T09:15:35Z","modified_at":"2026-04-21T04:38:33.198801Z","summary":"CVE-2025-12058 affecting package keras 3.3.3-6","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[],"affected":[{"ecosystem":"Azure Linux:3","package":"keras","purl":"pkg:rpm/azure-linux/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"3.3.3-6"}]}],"provider":"osv","source":"AZL-69021","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"}]},{"provider":"osv","source_id":"AZL-69583","relation":"self","url":"https://osv.dev/vulnerability/AZL-69583","license":"MIT","published_at":"2025-10-29T09:15:35Z","modified_at":"2026-04-21T04:38:37.675823Z","summary":"CVE-2025-12058 affecting package keras 2.11.0-3","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[],"affected":[{"ecosystem":"Azure Linux:2","package":"keras","purl":"pkg:rpm/azure-linux/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.11.0-3"}]}],"provider":"osv","source":"AZL-69583","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"}]},{"provider":"osv","source_id":"DEBIAN-CVE-2025-12058","relation":"self","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-12058","published_at":"2025-10-29T09:15:35.5Z","modified_at":"2026-08-27T23:05:22.621401Z","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).   This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.    *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.     *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.   The security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","source":"DEBIAN-CVE-2025-12058"}],"affected":[{"ecosystem":"Debian:11","package":"keras","purl":"pkg:deb/debian/keras?arch=source&distro=bullseye","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.1+dfsg-3","2.3.1+dfsg2-1"],"provider":"osv","source":"DEBIAN-CVE-2025-12058","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2025-12058"}]},{"provider":"osv","source_id":"GHSA-mq84-hjqx-cwf2","relation":"self","url":"https://osv.dev/vulnerability/GHSA-mq84-hjqx-cwf2","license":"CC-BY-4.0","published_at":"2025-10-29T09:30:22Z","modified_at":"2026-09-10T03:50:30.08821Z","summary":"Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","source":"GHSA-mq84-hjqx-cwf2"}],"affected":[{"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"versions":["0.2.0","0.3.0","0.3.1","0.3.2","0.3.3","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.1.1","1.1.2","1.2.0","1.2.1","1.2.2","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.10.0","2.10.0rc0","2.10.0rc1","2.11.0","2.11.0rc0","2.11.0rc1","2.11.0rc2","2.11.0rc3","2.12.0","2.12.0rc0","2.12.0rc1","2.13.1","2.13.1rc0","2.13.1rc1","2.14.0","2.14.0rc0","2.15.0","2.15.0rc0","2.15.0rc1","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.4.3","2.5.0rc0","2.6.0","2.6.0rc0","2.6.0rc1","2.6.0rc2","2.6.0rc3","2.7.0","2.7.0rc0","2.7.0rc2","2.8.0","2.8.0rc0","2.8.0rc1","2.9.0","2.9.0rc0","2.9.0rc1","2.9.0rc2","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1.0","3.1.1","3.10.0","3.11.0","3.11.1","3.11.2","3.11.3","3.2.0","3.2.1","3.3.0","3.3.1","3.3.2","3.3.3","3.4.0","3.4.1","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","3.9.1","3.9.2"],"fixed":["3.12.0"],"provider":"osv","source":"GHSA-mq84-hjqx-cwf2","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"},{"type":"WEB","url":"https://github.com/keras-team/keras/pull/21751"},{"type":"WEB","url":"https://github.com/keras-team/keras/commit/61ac8c1e51862c471dee7b49029c356f55531487"},{"type":"PACKAGE","url":"https://github.com/keras-team/keras"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"}]},{"provider":"osv","source_id":"PYSEC-2026-1487","relation":"self","url":"https://osv.dev/vulnerability/PYSEC-2026-1487","license":"CC-BY-4.0","published_at":"2026-07-07T16:03:08.498075Z","modified_at":"2026-07-07T17:57:32.00664Z","summary":"Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF).\n\n\nThis vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.\n\n  *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.\n\n\n  *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition.\n\n\nThe security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","source":"PYSEC-2026-1487"}],"affected":[{"ecosystem":"PyPI","package":"keras","purl":"pkg:pypi/keras","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.12.0"}]}],"versions":["0.2.0","0.3.0","0.3.1","0.3.2","0.3.3","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.1.1","1.1.2","1.2.0","1.2.1","1.2.2","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.10.0","2.10.0rc0","2.10.0rc1","2.11.0","2.11.0rc0","2.11.0rc1","2.11.0rc2","2.11.0rc3","2.12.0","2.12.0rc0","2.12.0rc1","2.13.1","2.13.1rc0","2.13.1rc1","2.14.0","2.14.0rc0","2.15.0","2.15.0rc0","2.15.0rc1","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.4.3","2.5.0rc0","2.6.0","2.6.0rc0","2.6.0rc1","2.6.0rc2","2.6.0rc3","2.7.0","2.7.0rc0","2.7.0rc2","2.8.0","2.8.0rc0","2.8.0rc1","2.9.0","2.9.0rc0","2.9.0rc1","2.9.0rc2","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1.0","3.1.1","3.10.0","3.11.0","3.11.1","3.11.2","3.11.3","3.2.0","3.2.1","3.3.0","3.3.1","3.3.2","3.3.3","3.4.0","3.4.1","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","3.9.1","3.9.2"],"fixed":["3.12.0"],"provider":"osv","source":"PYSEC-2026-1487","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"},{"type":"WEB","url":"https://github.com/keras-team/keras/pull/21751"},{"type":"WEB","url":"https://github.com/keras-team/keras/commit/61ac8c1e51862c471dee7b49029c356f55531487"},{"type":"PACKAGE","url":"https://github.com/keras-team/keras"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"},{"type":"PACKAGE","url":"https://pypi.org/project/keras"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-mq84-hjqx-cwf2"}]},{"provider":"osv","source_id":"UBUNTU-CVE-2025-12058","relation":"self","url":"https://osv.dev/vulnerability/UBUNTU-CVE-2025-12058","license":"CC-BY-SA-4.0","published_at":"2025-10-29T09:15:00Z","modified_at":"2025-11-06T05:22:37Z","details":"The Keras.Model.load_model method, including when executed with the intended security mitigation safe_mode=True, is vulnerable to arbitrary local file loading and Server-Side Request Forgery (SSRF). This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path.   *  Arbitrary Local File Read: An attacker can create a malicious .keras file that embeds a local path in the StringLookup layer's configuration. When the model is loaded, Keras will attempt to read the content of the specified local file and incorporate it into the model state (e.g., retrievable via get_vocabulary()), allowing an attacker to read arbitrary local files on the hosting system.   *  Server-Side Request Forgery (SSRF): Keras utilizes tf.io.gfile for file operations. Since tf.io.gfile supports remote filesystem handlers (such as GCS and HDFS) and HTTP/HTTPS protocols, the same mechanism can be leveraged to fetch content from arbitrary network endpoints on the server's behalf, resulting in an SSRF condition. The security issue is that the feature allowing external path loading was not properly restricted by the safe_mode=True flag, which was intended to prevent such unintended data access.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L","source":"UBUNTU-CVE-2025-12058"},{"type":"Ubuntu","score":"medium","source":"UBUNTU-CVE-2025-12058"}],"affected":[{"ecosystem":"Ubuntu:18.04:LTS","package":"keras","purl":"pkg:deb/ubuntu/keras@2.1.1-1?arch=source&distro=bionic","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.7-2","2.1.1-1"],"provider":"osv","source":"UBUNTU-CVE-2025-12058","relation":"self"},{"ecosystem":"Ubuntu:20.04:LTS","package":"keras","purl":"pkg:deb/ubuntu/keras@2.2.4-1?arch=source&distro=focal","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.4-1"],"provider":"osv","source":"UBUNTU-CVE-2025-12058","relation":"self"}],"product_status":[],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2025-12058"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"},{"type":"REPORT","url":"https://github.com/keras-team/keras/pull/21751"},{"type":"REPORT","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"}]},{"provider":"redhat-vex","source_id":"CVE-2025-12058","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2025-12058","license":"CC-BY-4.0","published_at":"2025-10-29T08:48:29.689Z","modified_at":"2026-03-16T08:31:18Z","summary":"keras: Keras Model.load_model Arbitrary Local File Loading and SSRF","details":"A bypass of safe mode has been discovered in Keras. This vulnerability stems from the way the StringLookup layer is handled during model loading from a specially crafted .keras archive. The constructor for the StringLookup layer accepts a vocabulary argument that can specify a local file path or a remote file path. This may result in an attacker being able to read arbitrary files from the host system or fetch content from arbitrary network endpoints.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L","source":"CVE-2025-12058"},{"type":"Red Hat","score":"Moderate","source":"CVE-2025-12058"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9","rhoai/odh-modelmesh-runtime-adapter-rhel8","rhoai/odh-modelmesh-runtime-adapter-rhel9","rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9","rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9","rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9","rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9"],"package_count":10,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2025-12058"},{"vendor":"Red Hat","product":"Red Hat Trusted Artifact Signer","cpe":"cpe:/a:redhat:trusted_artifact_signer:1","status":"affected","packages":["rhtas/model-transparency-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2025-12058"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-12058.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2025-12058"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2407019"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"},{"type":"WEB","url":"https://github.com/keras-team/keras/pull/21751"},{"type":"WEB","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"}]}],"references":[{"type":"WEB","url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"},{"type":"WEB","url":"https://github.com/keras-team/keras/pull/21751"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2025-12058"},{"type":"WEB","url":"https://github.com/keras-team/keras/commit/61ac8c1e51862c471dee7b49029c356f55531487"},{"type":"PACKAGE","url":"https://github.com/keras-team/keras"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"},{"type":"PACKAGE","url":"https://pypi.org/project/keras"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-mq84-hjqx-cwf2"},{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2025-12058"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-12058.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2025-12058"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2407019"}],"sources":[{"provider":"osv","source_id":"CLSA-2026-1794298440","url":"https://osv.dev/vulnerability/CLSA-2026-1794298440","modified_at":"2026-11-17T13:31:19.829942Z","relation":"upstream"},{"provider":"cvelistv5","source_id":"CVE-2025-12058","url":"https://www.cve.org/CVERecord?id=CVE-2025-12058","license":"CC-BY-4.0","modified_at":"2025-10-29T14:11:03.027Z","relation":"self"},{"provider":"osv","source_id":"AZL-69021","url":"https://osv.dev/vulnerability/AZL-69021","license":"MIT","modified_at":"2026-04-21T04:38:33.198801Z","relation":"self"},{"provider":"osv","source_id":"AZL-69583","url":"https://osv.dev/vulnerability/AZL-69583","license":"MIT","modified_at":"2026-04-21T04:38:37.675823Z","relation":"self"},{"provider":"osv","source_id":"DEBIAN-CVE-2025-12058","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-12058","modified_at":"2026-08-27T23:05:22.621401Z","relation":"self"},{"provider":"osv","source_id":"GHSA-mq84-hjqx-cwf2","url":"https://osv.dev/vulnerability/GHSA-mq84-hjqx-cwf2","license":"CC-BY-4.0","modified_at":"2026-09-10T03:50:30.08821Z","relation":"self"},{"provider":"osv","source_id":"PYSEC-2026-1487","url":"https://osv.dev/vulnerability/PYSEC-2026-1487","license":"CC-BY-4.0","modified_at":"2026-07-07T17:57:32.00664Z","relation":"self"},{"provider":"osv","source_id":"UBUNTU-CVE-2025-12058","url":"https://osv.dev/vulnerability/UBUNTU-CVE-2025-12058","license":"CC-BY-SA-4.0","modified_at":"2025-11-06T05:22:37Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2025-12058","url":"https://access.redhat.com/security/cve/CVE-2025-12058","license":"CC-BY-4.0","modified_at":"2026-03-16T08:31:18Z","relation":"self"}]}
