---
id: "CVE-2025-49655"
kind: "vulnerability"
aliases: ["CVE-2025-49655", "GHSA-cvhh-q5g5-qprp"]
title: "Keras framework vulnerable to deserialization of untrusted data"
severity: "critical"
cvss: 9.8
epss: 0.0075
exploited: false
status: "open"
category: "package"
products: [{"name": "keras", "fixed": ["3.11.3"], "affected": ">= 3.11.0, < 3.11.3", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-502", "keras", "ml-pipelines", "model-serving", "package", "python"]
not_affected_if: ["keras-3.11.3-or-later", "keras-below-3.11.0", "only-trusted-local-models"]
published_at: "2025-10-17T16:15:37+00:00"
first_seen_at: "2026-10-27T17:22:22+00:00"
updated_at: "2026-10-27T17:32:47+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-cvhh-q5g5-qprp", "first_seen_at": "2026-10-27T17:22:22+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-49655", "first_seen_at": "2026-10-27T17:32:47+00:00"}]
---

# Keras framework vulnerable to deserialization of untrusted data

Keras versions 3.11.0 up to 3.11.3 deserialize a TorchModuleWrapper class from a model file, so a malicious .keras file can run arbitrary code when loaded. The code runs even with safe mode enabled.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:keras affected >= 3.11.0, < 3.11.3 fixed 3.11.3

## How to check

- Run `pip show keras` and look for a version from `3.11.0` up to but not including `3.11.3`
- Search requirements files and lockfiles for `keras` pins in that range

## Fix

- Upgrade the pypi package keras to `3.11.3`
- Only load model files from trusted sources until the upgrade is done

## Timeline

- 2026-10-27T17:22:22+00:00 ghsa https://github.com/advisories/GHSA-cvhh-q5g5-qprp
- 2026-10-27T17:32:47+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2025-49655

## From the sources

Deserialization of untrusted data can occur in versions of the Keras framework running versions 3.11.0 up to but not including 3.11.3, enabling a maliciously uploaded Keras file containing a TorchModuleWrapper class to run arbitrary code on an end user’s system when loaded despite safe mode being enabled. The vulnerability can be triggered through both local and remote files.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
