Skip to content
Threat Feed
high advisory

Unsafe Deserialization Vulnerability in docTR

docTR versions through 1.1.0 are vulnerable to arbitrary code execution via unsafe deserialization of pickle payloads within the load_pretrained_params() function.

CVE search metadata

CVE search record: CVE-2026-112304. Severity: high. CVSS: 7.5. KEV: no. Product: docTR (<= 1.1.0). Brief: Unsafe Deserialization Vulnerability in docTR. Brief link: https://feed.craftedsignal.io/briefs/2026-10-doctr-deserialization/

Mindee docTR (Document Text Recognition) versions through 1.1.0 contain a critical unsafe deserialization vulnerability identified as CVE-2026-112304. The vulnerability exists within the load_pretrained_params() function, which invokes torch.load to process model checkpoints. By default, the library fails to set the weights_only=True parameter, which is a required security configuration for loading untrusted PyTorch models.

An attacker who can provide a malicious checkpoint file - either via local storage or a remote URL - can embed a malicious pickle payload within the file. When load_pretrained_params() processes this file, the underlying PyTorch mechanism (on versions prior to 2.6) will deserialize the payload, resulting in arbitrary Python code execution under the security context of the user or service running the docTR library. This vulnerability is significant for environments where document processing pipelines ingest user-supplied model files or rely on potentially compromised remote storage.

Impact

Successful exploitation of this vulnerability allows an attacker to achieve arbitrary code execution on the system running the docTR library. This could lead to a full compromise of the application server, data exfiltration from the processing environment, or lateral movement within the network. The scope affects any application utilizing docTR version 1.1.0 or earlier for OCR tasks.

Recommendation

  • Update docTR to a version that enforces weights_only=True in load_pretrained_params().
  • If patching is not immediately feasible, audit the code to ensure load_pretrained_params() is only ever called with trusted, verified local model files.
  • Verify the PyTorch version in the environment and ensure it is updated to 2.6 or later to benefit from improved default deserialization safety.
  • Implement file integrity monitoring on any directory where model checkpoints are stored to detect unauthorized modifications.

Immediate actions

Upgrade docTR to 2.6 or later

IT Operations 48h

Mitigations

Upgrade PyTorch to 2.6 or later to mitigate unsafe deserialization defaults.

immediate IT Operations

CVE-2026-112304