---
id: "CVE-2026-112304"
kind: "vulnerability"
aliases: ["CVE-2026-112304"]
title: "docTR: unsafe checkpoint loading lets a malicious model file run code"
severity: "high"
cvss: 7.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["ml-pipelines", "package", "python", "python-doctr", "pytorch"]
not_affected_if: ["fixed-trusted-checkpoints", "no-load_pretrained_params-calls"]
published_at: "2026-10-19T16:17:06+00:00"
first_seen_at: "2026-10-23T21:57:18+00:00"
updated_at: "2026-10-25T03:10:53+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112304", "first_seen_at": "2026-10-23T21:57:18+00:00"}]
---

# docTR: unsafe checkpoint loading lets a malicious model file run code

docTR's load_pretrained_params() calls torch.load without weights_only=True, so it unpickles checkpoint files. A crafted checkpoint, supplied locally or fetched from a URL, can run Python code with the privileges of the process that loads it.

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

## How to check

- Run `pip show python-doctr` and check whether the version is 1.1.0 or earlier.
- Run `pip show torch` and check whether the version is below `2.6`.
- Search your code for calls to `load_pretrained_params` or `torch.load` that take checkpoints from users or remote URLs.

## Fix

- Upgrade python-doctr to a release later than `1.1.0` once one is available; the sources do not name a fixed version.
- Upgrade torch to `2.6` or later.
- Only load checkpoints from trusted, locally verified sources until patched.

## Timeline

- 2026-10-23T21:57:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-112304

## From the sources

docTR through 1.1.0 contains an unsafe deserialization vulnerability in load_pretrained_params() that loads checkpoints with torch.load without weights_only=True. Attackers who control a local or URL-supplied checkpoint can embed a malicious pickle payload to execute Python code with the loading process's privileges on torch releases before 2.6.

---

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