/

CVE-2026-38950

Severity:

HIGH RISK

(7.8)

Unsafe Deserialization in ESA AnomalyMatch Checkpoint

CVE-2026-38950

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ESA AnomalyMatch versions before 1.3.1 unsafely deserialize model checkpoint files using torch.load() without restricting the objects that can be instantiated.

If an attacker can influence or supply crafted checkpoint files in session directories, they may be able to execute arbitrary code in the context of the AnomalyMatch process.

Affected context

This vulnerability occurs in ESA AnomalyMatch deployments that load PyTorch model checkpoint files from session-specific directories.

The risk materializes when model files are treated as trusted input, such as when they are uploaded, synchronized, or otherwise influenced by external actors without strict validation or origin controls.

In these contexts, the torch.load() call is used with full deserialization capabilities, allowing arbitrary Python object construction during model loading.

Exploit preconditions

  • Attack surface: Model checkpoint loading logic within ESA AnomalyMatch.
  • Required access: Ability to write, replace, or influence checkpoint/model files in the relevant session directories (e.g., via upload, synchronization, or compromised storage).
  • Trigger point: Invocation of torch.load() on a crafted checkpoint file during normal AnomalyMatch workflows (such as model initialization, session loading, or anomaly analysis).
  • Why exploitation is possible: torch.load() performs generic Python object deserialization using pickle under the hood, and the application treats these checkpoint files as trusted, enabling attacker-controlled code to run when the file is loaded.

Why this happens

The underlying bug is the use of unrestricted deserialization for model checkpoint files, a classic instance of CWE-502: Unsafe Deserialization.

PyTorch's torch.load() relies on Python's pickle mechanism, which is designed for object reconstruction, not for parsing untrusted data.

When checkpoint files from session directories are deserialized without verifying their provenance, applying a restricted loading mechanism, or constraining which objects may be instantiated, an attacker can embed payloads that execute during deserialization.

Conceptually, the application conflates "structured data for model parameters" with "trusted serialized objects," leading to a code execution primitive whenever crafted checkpoints are loaded.

Potential impact

  • Execution of arbitrary code with the privileges of the ESA AnomalyMatch process.
  • Compromise of the host running AnomalyMatch, including further lateral movement in the environment.
  • Manipulation or exfiltration of sensitive anomaly detection data and configuration.
  • Tampering with detection models, potentially degrading anomaly detection accuracy or hiding malicious activity.
  • Use of the compromised AnomalyMatch instance as a pivot point for broader infrastructure attacks.

General mitigation guidance

Effective mitigation focuses on reducing trust in serialized model artifacts and constraining deserialization behavior:

  • Prefer safe model loading patterns over generic object deserialization, such as using APIs that load only tensors and known model structures rather than arbitrary Python objects.
  • Introduce an explicit trust boundary for checkpoint files: restrict who can create or modify them, and avoid loading artifacts from user-controlled or session-temporary locations without strong validation.
  • Apply cryptographic signing or integrity verification to checkpoint files, and reject any artifact that fails verification.
  • Isolate the model loading component with least-privilege execution (e.g., reduced OS permissions, containerization, or sandboxing) to limit blast radius if a malformed model is encountered.
  • Enforce strict file-system permissions on session directories to prevent unauthorized modification of model artifacts.

How teams detect issues like this

Detection typically involves analyzing both code patterns and runtime behavior:

  • Use static analysis or code scanning rules to flag uses of torch.load() and other pickle-based APIs when applied to data that can originate outside tightly controlled build pipelines.
  • During code review, treat any deserialization of model artifacts as a security-sensitive operation; verify that loading paths are restricted and that artifacts are authenticated.
  • Implement logging around model loading operations, including the source path, checksum, and relevant user/session metadata; monitor for unusual or unexpected checkpoint sources.
  • Employ host and application monitoring to detect anomalous processes, network connections, or file modifications originating from the AnomalyMatch service around the time model files are loaded.

Sources

SourceLink
github.comgithub.com/Accenture/AARO-Bugs/blob/master/AARO-CVE-List.md
github.comgithub.com/esa/AnomalyMatch/pull/9
imlabs.infoimlabs.info/research/security_advisory_esa_anomaly_match_unsafe_deserialization_cve_2026_38950_ivan_markovic_052026.html

Frequently asked

questions

It can be, depending on how ESA AnomalyMatch is deployed. If attackers can upload or otherwise influence checkpoint files remotely (for example, through an exposed interface or compromised storage service), they may trigger remote code execution when those files are loaded.

The attacker needs the ability to write or replace model checkpoint files in the session directories that AnomalyMatch later reads. This may be achieved through user interfaces, shared storage, CI/CD pipelines, or any mechanism that feeds model artifacts into the system.

The most robust approach is to avoid generic object deserialization for untrusted model artifacts. Use safer loading mechanisms that reconstruct only expected tensors and architectures, and enforce authenticity checks (such as signatures) before loading any checkpoint.

Treat all serialized artifacts, including ML models, as untrusted by default. Establish secure-by-design patterns for model loading, enforce strong provenance and integrity guarantees, avoid pickle-based APIs for external data, and integrate security reviews and automated checks for deserialization usage into the development lifecycle.

Find out what's already
exploitable in your codebase.