/

CVE-2026-24009

Severity:

HIGH RISK

(8.1)

Unsafe Deserialization in Docling Core

CVE-2026-24009

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.1)

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

Docling Core exposes an unsafe YAML deserialization path that can lead to remote code execution when untrusted YAML is passed to DoclingDocument.load_from_yaml() and processed with vulnerable PyYAML loaders.

In affected versions, using yaml.FullLoader with older PyYAML releases allows attackers controlling the YAML input to instantiate arbitrary Python objects, potentially executing code within the document-processing application.

Affected context

This vulnerability affects applications that:

  • Depend on docling-core versions >= 2.21.0 and < 2.48.4
  • Use PyYAML versions prior to 5.4
  • Call docling_core.types.doc.DoclingDocument.load_from_yaml() with YAML content derived from external or otherwise untrusted sources

The risk materializes in document-processing pipelines or services that ingest YAML-based document representations without strict trust or validation assumptions.

Exploit preconditions

  • Attack surface: Any component, service, or batch job that:
  • Uses docling-core's DoclingDocument.load_from_yaml() API
  • Accepts YAML input from users, external integrations, or unverified files
  • Required access: Ability to supply or modify YAML content consumed by load_from_yaml() (e.g., file upload, API parameter, message queue payload, or configuration entry).
  • Trigger point: Invocation of DoclingDocument.load_from_yaml() on the attacker-controlled YAML while docling-core uses yaml.FullLoader with a PyYAML version vulnerable to CVE-2020-14343.
  • Why exploitation is possible: yaml.FullLoader in affected PyYAML versions can construct arbitrary Python objects from YAML tags. When this behavior is applied to untrusted input, object constructors and side effects may execute during deserialization, enabling code execution rather than mere data parsing.

Why this happens

The core issue is the use of a powerful, general-purpose YAML loader (yaml.FullLoader) on data that may originate from untrusted sources.

This loader supports arbitrary object construction and advanced YAML features that extend beyond simple data representation.

When docling-core's DoclingDocument.load_from_yaml() delegates parsing to this loader without constraining its capabilities, it aligns with CWE-502: Deserialization of Untrusted Data: attacker-controlled serialized content is treated as a specification for runtime objects and behavior.

The safe pattern for configuration and document formats is to employ restricted loaders (e.g., SafeLoader) that only produce primitive types and simple collections, preventing arbitrary code-linked constructions during deserialization.

Potential impact

  • Execution of arbitrary Python code within the context of the document-processing application
  • Compromise of the host process, including access to its permissions, network reach, and environment variables
  • Unauthorized access to or modification of processed documents and associated metadata
  • Use of the compromised service as a pivot point for further lateral movement in the environment
  • Data exfiltration, tampering, or deletion within the scope of the affected application

General mitigation guidance

Effective mitigation focuses on restricting deserialization behavior and tightening trust boundaries around YAML inputs:

  • Prefer secure, restricted YAML loaders that deserialize into primitive data structures only, avoiding arbitrary object construction.
  • Treat all external YAML content as untrusted by default, even if it originates from internal services or partners, and minimize the accepted feature set.
  • Introduce strict schema validation for YAML-based document representations so that only expected keys, types, and structures are allowed.
  • Separate parsing and interpretation layers: first convert YAML into benign data structures, then explicitly map those to application objects using validation and normalization logic.
  • Reduce the privilege level of services that perform deserialization (least-privilege execution, filesystem and network constraints, and container sandboxing) to limit blast radius if a parsing component is compromised.
  • Prefer configuration and document formats that are less feature-rich or have simpler security models where possible (e.g., JSON or schema-constrained formats) for untrusted input flows.

How teams detect issues like this

Detecting and managing this class of issue typically involves several complementary approaches:

  • Static analysis and code scanning:
  • Flag usage of dangerous deserialization APIs such as yaml.load or yaml.FullLoader when called on non-literal input.
  • Look for wrapper methods (such as load_from_yaml()) that delegate to YAML loaders without enforcing trusted sources or validation.
  • Code review practices:
  • Require explicit review of any new or modified deserialization logic, focusing on loaders, allowed types, and input trust assumptions.
  • Use secure coding checklists that call out unsafe deserialization as a specific review item, especially in data ingestion and document-processing modules.
  • Policy and tooling:
  • Enforce organization-wide standards around YAML parsing (e.g., "only SafeLoader or equivalent is allowed for untrusted data") via linting rules or pre-commit hooks.
  • Integrate SCA (software composition analysis) tools that can flag known vulnerable combinations of libraries (e.g., specific PyYAML versions with unsafe deserialization behavior) and known CVEs in transitive dependencies.
  • Runtime monitoring:
  • Monitor for abnormal behavior from document-processing services (unexpected outbound connections, file system modifications, or shell process creation), which may indicate exploitation of unsafe deserialization paths.

Sources

SourceLink
github.comgithub.com/advisories/GHSA-8q59-q68h-6hv4
github.comgithub.com/docling-project/docling-core/commit/3e8d628eeeae50f0f8f239c8c7fea773d065d80c
github.comgithub.com/docling-project/docling-core/issues/482
github.comgithub.com/docling-project/docling-core/releases/tag/v2.48.4
github.comgithub.com/docling-project/docling-core/security/advisories/GHSA-vqxf-v2gg-x3hc

Frequently asked

questions

It can be, depending on how the application exposes DoclingDocument.load_from_yaml(). If YAML content can be supplied over a network interface (such as HTTP APIs, message queues, or remote file uploads), an attacker may be able to exploit the issue remotely by providing crafted YAML that reaches the vulnerable deserialization call.

The attacker needs the ability to control or influence the YAML data passed to DoclingDocument.load_from_yaml() in an environment using a vulnerable PyYAML and affected docling-core versions. This can be as simple as uploading a document, providing a configuration file, or sending an API request if those inputs are directly or indirectly fed into the method without strong validation.

The robust fix pattern is to ensure that all YAML parsing of untrusted data uses restricted loaders (such as SafeLoader or equivalents) that cannot instantiate arbitrary objects, combined with schema validation of parsed content. Additionally, reviewing the codebase for other deserialization points and standardizing on secure deserialization practices across the application helps avoid similar issues.

Prevention is best achieved by institutionalizing secure deserialization guidelines: mandate safe loaders for all untrusted input, document and enforce which serialization formats are allowed where, and treat deserialization code as security-sensitive. Complement these practices with automated checks (static analysis, SCA tools, and CI policies) and security-aware code reviews that specifically scrutinize data parsing and object construction boundaries.

Find out what's already
exploitable in your codebase.