> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flintai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Unsafe deserialization

> Agent deserializes untrusted data (pickle, YAML load, JSON with class hooks) enabling code execution

Agent deserializes untrusted data (pickle, YAML load, JSON with class hooks) enabling code execution

## How to resolve

Replace pickle.loads() with json.loads(). Use yaml.safe\_load() instead of yaml.load(). Never deserialize data from untrusted sources.

## Risk

**Governance/Compliance**

This vulnerability falls under [ASI05:2026 — Unexpected Code Execution](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/) in the OWASP Top 10 for Agentic Applications. Agent generates or runs code, commands, or scripts without safe sandboxing or review.

**Security**

Agent deserializes untrusted data (pickle, YAML load, JSON with class hooks) enabling code execution. If exploited, this can compromise the agent's integrity, confidentiality, or availability, potentially affecting downstream systems and data.

## Explanation

Agent deserializes untrusted data (pickle, YAML load, JSON with class hooks) enabling code execution. This falls under ASI05 (Unexpected Code Execution): Agent generates or runs code, commands, or scripts without safe sandboxing or review.

## Specifications

**Trigger**

* Agent scan detects agent deserializes untrusted data (pickle, YAML load, JSON with class hooks) enabling code execution

The scanner looks for patterns such as:

* pickle.loads() on external data
* yaml.load() without SafeLoader
* json deserialization with object\_hook

**Severity**

* HIGH

**Applies to**: Agent
