CVE-2026-112304: docTR: unsafe torch.load deserialization enables RCE
HIGHdocTR through 1.1.0 loads model checkpoints with torch.load without weights_only=True, so a malicious pickle embedded in a checkpoint file or URL-supplied weights executes arbitrary Python code in the loading process (CWE-502). The CVSS is 7.5 (high) and requires user interaction and high attack complexity, because the attacker must get a victim to load a tampered checkpoint. Exploitation likelihood is low-to-moderate: EPSS is 0.0029 (top 80th percentile), the CVE is not in CISA KEV, and no public exploit or Nuclei template exists. Dependent counts are unknown, but docTR is a widely used OCR library often embedded in document-processing pipelines that run with access to sensitive data. Upgrade to a docTR release that includes the fix commit 687503d, upgrade torch to 2.6 or later (where weights_only defaults to True), and only load checkpoints from trusted, integrity-verified sources.
What is the risk?
Moderate overall risk. Impact is full code execution (C:H/I:H/A:H) with the privileges of the loading process, but exploitation needs a victim to load an attacker-controlled checkpoint (UI:R, AC:H). Exposure is greatest where checkpoint paths or URLs are configurable by users or pulled from untrusted hubs. Environments on torch 2.6 or later are largely protected because weights_only defaults to True. No known active exploitation, no KEV listing, and a low EPSS of 0.0029 lower near-term urgency, but the pickle attack class is trivial once a malicious file is delivered.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| docTR | — | — | No patch |
Do you use docTR? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade docTR to a version containing the fix (commit 687503dd) once released, or apply the patch manually. 2) Upgrade torch to 2.6 or later so torch.load defaults to weights_only=True. 3) Only load checkpoints from trusted sources, verify hashes or signatures, and prefer safetensors formats. 4) Do not allow end users to supply checkpoint paths or URLs. 5) Run model loading in sandboxed, least-privilege containers with restricted egress. 6) Scan checkpoint files with picklescan or fickling before use. 7) Detect by inventorying docTR versions via SBOM and monitoring for unexpected child processes or outbound connections from OCR workers.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-112304?
docTR through 1.1.0 loads model checkpoints with torch.load without weights_only=True, so a malicious pickle embedded in a checkpoint file or URL-supplied weights executes arbitrary Python code in the loading process (CWE-502). The CVSS is 7.5 (high) and requires user interaction and high attack complexity, because the attacker must get a victim to load a tampered checkpoint. Exploitation likelihood is low-to-moderate: EPSS is 0.0029 (top 80th percentile), the CVE is not in CISA KEV, and no public exploit or Nuclei template exists. Dependent counts are unknown, but docTR is a widely used OCR library often embedded in document-processing pipelines that run with access to sensitive data. Upgrade to a docTR release that includes the fix commit 687503d, upgrade torch to 2.6 or later (where weights_only defaults to True), and only load checkpoints from trusted, integrity-verified sources.
Is CVE-2026-112304 actively exploited?
No confirmed active exploitation of CVE-2026-112304 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-112304?
1) Upgrade docTR to a version containing the fix (commit 687503dd) once released, or apply the patch manually. 2) Upgrade torch to 2.6 or later so torch.load defaults to weights_only=True. 3) Only load checkpoints from trusted sources, verify hashes or signatures, and prefer safetensors formats. 4) Do not allow end users to supply checkpoint paths or URLs. 5) Run model loading in sandboxed, least-privilege containers with restricted egress. 6) Scan checkpoint files with picklescan or fickling before use. 7) Detect by inventorying docTR versions via SBOM and monitoring for unexpected child processes or outbound connections from OCR workers.
What systems are affected by CVE-2026-112304?
This vulnerability affects the following AI/ML architecture patterns: Document OCR pipelines, Model serving, Training and fine-tuning pipelines, Model loading from external registries.
What is the CVSS score for CVE-2026-112304?
CVE-2026-112304 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.37%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.003ModelAML.T0011.000Unsafe AI ArtifactsAML.T0018.002Embed MalwareAML.T0058Publish Poisoned ModelsCompliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An attacker publishes a fine-tuned docTR text-recognition checkpoint on a public model hub or file share, advertising improved accuracy on a specific document type. A data scientist or an automated pipeline downloads it and calls load_pretrained_params(), which runs torch.load without weights_only=True. The embedded pickle payload executes on load, giving the attacker a reverse shell on the GPU or inference host, where they harvest cloud credentials and access document data processed by the OCR service.
Weaknesses (CWE)
CWE-502 — Deserialization of Untrusted Data: The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
- [Architecture and Design, Implementation] If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- [Implementation] When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:HReferences
- github.com/mindee/doctr/blob/v1.1.0/doctr/models/utils/pytorch.pytechnical-description
- github.com/mindee/doctr/commit/687503dd15592483c4699ee51280b41938579a9epatch
- github.com/mindee/doctr/issues/2175issue-tracking
- vulncheck.com/advisories/doctr-through-1.1.0-unsafe-deserialization-rce-via-load-pretrained-paramsthird-party-advisory
Timeline
Related Vulnerabilities
CVE-2025-5952810.0Flowise: Unauthenticated RCE via MCP config injection
Same attack type: Supply ChainCVE-2024-291210.0BentoML: RCE via insecure deserialization (CVSS 10)
Same attack type: Supply ChainCVE-2023-376510.0MLflow: path traversal allows arbitrary file read
Same attack type: Supply ChainCVE-2025-512010.0smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Supply ChainCVE-2026-2185810.0n8n: Input Validation flaw enables exploitation
Same attack type: Code Execution