# CVE-2026-12484: Unsafe Deserialization in keras.layers.TorchModuleWrapper.from_config

> Attackers can execute arbitrary code by providing malicious PyTorch pickle data to the TorchModuleWrapper.from_config method in Keras.

- **Severity:** High 7.8 (`CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 19 Jul 2026
- **Updated:** 20 Jul 2026
- **Also known as:** DEBIAN-CVE-2026-12484, GHSA-v2w2-w228-c444, MINI-x5m7-w2pq-c3wv, PYSEC-2026-3634, UBUNTU-CVE-2026-12484

## What is CVE-2026-12484?

CVE-2026-12484 is a high-severity unsafe deserialization vulnerability in keras-team/keras, published on 19 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

A vulnerability in keras-team/keras version 3.15.0 allows unsafe deserialization of attacker-controlled PyTorch pickle data through the public `keras.layers.TorchModuleWrapper.from_config` method. This method invokes `torch.load(..., weights_only=False)` without requiring an explicit unsafe opt-in, such as a `safe_mode=False` parameter. When called outside a `SafeModeScope(True)` context, the absence of an ambient safe mode state permits unsafe deserialization by default. This issue can lead to arbitrary code execution if untrusted Keras layer configurations are processed using this method. The vulnerability arises because the method does not enforce safe deserialization practices unless explicitly guarded by Keras safe mode.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2026-12484?

5 open source packages ship an affected version, including keras.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `keras` | PyPI | All versions | 3.12.3, 3.15.0 |
| `keras` | PyPI | All versions | 3.12.3 |
| `keras` | PyPI | All versions | 3.12.3 |
| `keras` | PyPI | From 3.13.0 | 3.15.0 |
| `keras` | PyPI | From 3.13.0 | 3.15.0 |

## How do I fix CVE-2026-12484?

Upgrade keras to a fixed version for your release line: 3.12.3 or 3.15.0.

## Is CVE-2026-12484 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12484 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-12484 and fix it if it is affected.

What it is: CVE-2026-12484 is a high-severity unsafe deserialization vulnerability in keras-team/keras, published on 19 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12484 exists.

Affected packages and fixed versions:
- keras (PyPI): affected all versions; fixed in 3.12.3, 3.15.0
- keras (PyPI): affected all versions; fixed in 3.12.3
- keras (PyPI): affected all versions; fixed in 3.12.3
- keras (PyPI): affected from 3.13.0; fixed in 3.15.0
- keras (PyPI): affected from 3.13.0; fixed in 3.15.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-12484/ (Markdown: https://insights.sbomify.com/CVE-2026-12484/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-12484
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-12484
- OSV: https://osv.dev/vulnerability/CVE-2026-12484

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-12484/
Summaries are generated and may contain mistakes; the official description above is the record.
