{"url":"http://public2.vulnerablecode.io/api/packages/47087?format=json","purl":"pkg:pypi/keras@3.12.0","type":"pypi","namespace":"","name":"keras","version":"3.12.0","qualifiers":{},"subpath":"","is_vulnerable":true,"next_non_vulnerable_version":"3.13.2","latest_non_vulnerable_version":"3.13.2","affected_by_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/37184?format=json","vulnerability_id":"VCID-1xj9-1kng-8ua4","summary":"Allocation of Resources Without Limits or Throttling in the HDF5 weight loading component in Google Keras 3.0.0 through 3.13.0 on all platforms allows a remote attacker to cause a Denial of Service (DoS) through memory exhaustion and a crash of the Python interpreter via a crafted .keras archive containing a valid model.weights.h5 file whose dataset declares an extremely large shape.","references":[{"reference_url":"https://github.com/keras-team/keras/pull/21880","reference_id":"","reference_type":"","scores":[{"value":"7.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}],"url":"https://github.com/keras-team/keras/pull/21880"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/47091?format=json","purl":"pkg:pypi/keras@3.13.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-ptyp-n4df-aqf1"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.13.1"}],"aliases":["CVE-2026-0897","PYSEC-2026-73"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-1xj9-1kng-8ua4"}],"fixing_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/49319?format=json","vulnerability_id":"VCID-1wr2-9bym-kke5","summary":"Keras Directory Traversal Vulnerability\nKeras's `keras.utils.get_file()` function is vulnerable to directory traversal attacks despite implementing `filter_safe_paths()`. The vulnerability exists because `extract_archive()` uses Python's `tarfile.extractall()` method without the security-critical `filter=\"data\"` parameter. A PATH_MAX symlink resolution bug occurs before path filtering, allowing malicious tar archives to bypass security checks and write files outside the intended extraction directory.","references":[{"reference_url":"https://github.com/keras-team/keras","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras"},{"reference_url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951"},{"reference_url":"https://github.com/keras-team/keras/pull/21760","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/pull/21760"},{"reference_url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4","reference_id":"","reference_type":"","scores":[],"url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12060","reference_id":"CVE-2025-12060","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12060"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12638","reference_id":"CVE-2025-12638","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12638"},{"reference_url":"https://github.com/advisories/GHSA-hjqc-jx6g-rwp9","reference_id":"GHSA-hjqc-jx6g-rwp9","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-hjqc-jx6g-rwp9"},{"reference_url":"https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9","reference_id":"GHSA-hjqc-jx6g-rwp9","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/47087?format=json","purl":"pkg:pypi/keras@3.12.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.12.0"}],"aliases":["CVE-2025-12060","GHSA-hjqc-jx6g-rwp9"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-1wr2-9bym-kke5"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/49274?format=json","vulnerability_id":"VCID-4mb7-t1tm-eqf8","summary":"Duplicate Advisory: Keras keras.utils.get_file API is vulnerable to a path traversal attack\n### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-hjqc-jx6g-rwp9. This link is maintained to preserve external references.\n\n### Original Description\nKeras version 3.11.3 is affected by a path traversal vulnerability in the keras.utils.get_file() function when extracting tar archives. The vulnerability arises because the function uses Python's tarfile.extractall() method without the security-critical filter='data' parameter. Although Keras attempts to filter unsafe paths using filter_safe_paths(), this filtering occurs before extraction, and a PATH_MAX symlink resolution bug triggers during extraction. This bug causes symlink resolution to fail due to path length limits, resulting in a security bypass that allows files to be written outside the intended extraction directory. This can lead to arbitrary file writes outside the cache directory, enabling potential system compromise or malicious code execution. The vulnerability affects Keras installations that process tar archives with get_file() and does not affect versions where this extraction method is secured with the appropriate filter parameter.","references":[{"reference_url":"https://github.com/keras-team/keras","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras"},{"reference_url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951"},{"reference_url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4","reference_id":"","reference_type":"","scores":[],"url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12638","reference_id":"CVE-2025-12638","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12638"},{"reference_url":"https://github.com/advisories/GHSA-9g7v-8wxv-mwxp","reference_id":"GHSA-9g7v-8wxv-mwxp","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-9g7v-8wxv-mwxp"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/47087?format=json","purl":"pkg:pypi/keras@3.12.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.12.0"}],"aliases":["CVE-2025-12638","GHSA-9g7v-8wxv-mwxp"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-4mb7-t1tm-eqf8"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/48306?format=json","vulnerability_id":"VCID-c11z-ye25-k7eh","summary":"Duplicate Advisory: Keras keras.utils.get_file API is vulnerable to a path traversal attack\n### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-hjqc-jx6g-rwp9. This link is maintained to preserve external references.\n\n### Original Description\nThe keras.utils.get_file API in Keras, when used with the extract=True option for tar archives, is vulnerable to a path traversal attack. The utility uses Python's tarfile.extractall function without the filter=\"data\" feature. A remote attacker can craft a malicious tar archive containing special symlinks, which, when extracted, allows them to write arbitrary files to any location on the filesystem outside of the intended destination folder. This vulnerability is linked to the underlying Python tarfile weakness, identified as CVE-2025-4517. Note that upgrading Python to one of the versions that fix CVE-2025-4517 (e.g. Python 3.13.4) is not enough. One additionally needs to upgrade Keras to a version with the fix (Keras 3.12).","references":[{"reference_url":"https://github.com/keras-team/keras","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras"},{"reference_url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951"},{"reference_url":"https://github.com/keras-team/keras/pull/21760","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/pull/21760"},{"reference_url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4","reference_id":"","reference_type":"","scores":[],"url":"https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12060","reference_id":"CVE-2025-12060","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12060"},{"reference_url":"https://github.com/advisories/GHSA-28jp-44vh-q42h","reference_id":"GHSA-28jp-44vh-q42h","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-28jp-44vh-q42h"},{"reference_url":"https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9","reference_id":"GHSA-hjqc-jx6g-rwp9","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/47087?format=json","purl":"pkg:pypi/keras@3.12.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.12.0"}],"aliases":["GHSA-28jp-44vh-q42h"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-c11z-ye25-k7eh"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/48199?format=json","vulnerability_id":"VCID-h5tb-645a-3fdv","summary":"Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery\nThe 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.","references":[{"reference_url":"https://github.com/keras-team/keras","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras"},{"reference_url":"https://github.com/keras-team/keras/commit/61ac8c1e51862c471dee7b49029c356f55531487","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/commit/61ac8c1e51862c471dee7b49029c356f55531487"},{"reference_url":"https://github.com/keras-team/keras/pull/21751","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/pull/21751"},{"reference_url":"https://www.cve.org/CVERecord?id=CVE-2025-12058","reference_id":"","reference_type":"","scores":[],"url":"https://www.cve.org/CVERecord?id=CVE-2025-12058"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058","reference_id":"CVE-2025-12058","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-12058"},{"reference_url":"https://github.com/advisories/GHSA-mq84-hjqx-cwf2","reference_id":"GHSA-mq84-hjqx-cwf2","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-mq84-hjqx-cwf2"},{"reference_url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f","reference_id":"GHSA-qg93-c7p6-gg7f","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/security/advisories/GHSA-qg93-c7p6-gg7f"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/47087?format=json","purl":"pkg:pypi/keras@3.12.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.12.0"}],"aliases":["CVE-2025-12058","GHSA-mq84-hjqx-cwf2"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-h5tb-645a-3fdv"}],"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.12.0"}