Skip to main content
Vulnerability Database/CVE-2026-105742

CVE-2026-105742: Docling SSRF Vulnerability

CVE-2026-105742 is an SSRF vulnerability in Docling that exposes API keys and cookies to untrusted document authors through cross-origin redirects. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105742 Overview

CVE-2026-105742 is an information exposure vulnerability [CWE-201] in Docling, a Python library that parses diverse document formats for generative AI pipelines. The flaw resides in the HTML image resource loader at docling/backend/utils/image_resource_loader.py. Versions from 2.95.0 up to (but not including) 2.132.0 forward headers configured through HTMLBackendOptions.headers to every remote image URL referenced by an untrusted document. When enable_remote_fetch=True and fetch_images=True, the loader does not scope those credentials to the source document's origin. A malicious document author can harvest API keys or cookies by directing requests across origins.

Critical Impact

Attacker-controlled HTML documents can exfiltrate caller-configured API keys and cookies by referencing cross-origin image URLs or by triggering redirects that leak the configured headers.

Affected Products

  • Docling versions 2.95.0 through 2.131.x
  • Deployments that enable enable_remote_fetch=True
  • Deployments that set fetch_images=True with custom HTMLBackendOptions.headers

Discovery Timeline

  • 2026-10-05 - CVE-2026-105742 published to NVD
  • 2026-10-07 - Last updated in NVD database

Technical Details for CVE-2026-105742

Vulnerability Analysis

Docling's HTML backend accepts a headers dictionary in HTMLBackendOptions so operators can authenticate to private image hosts. When the parser processes an HTML document, it iterates over <img> tags and resolves each src attribute through image_resource_loader.py. The loader attaches the configured headers to every outbound request without checking the target origin. A document authored by an untrusted party can therefore list image URLs that point to arbitrary hosts, causing the client to transmit API keys, bearer tokens, or session cookies to attacker-controlled infrastructure.

The weakness is compounded by HTTP redirect handling. Even when the document references a legitimate image host, that host can respond with a 3xx redirect to an attacker endpoint, and the HTTP client re-sends the same authentication headers across the hop. This matches the Information Exposure to an Unauthorized Actor class defined in [CWE-201].

Root Cause

The root cause is missing origin validation in the resource loader. The code did not compare the request target against the source document's origin before attaching sensitive headers, and it did not strip headers across redirect boundaries.

Attack Vector

Exploitation requires a non-default configuration in which the operator has enabled remote fetching and set custom headers. An attacker supplies an HTML or EPUB document that references image URLs on hosts they control. When Docling parses the document, the client issues authenticated requests to the attacker's server, disclosing the configured credentials.

python
     html_image_headers: str = typer.Option(
         None,
         "--html-image-headers",
-        help="Specify http request headers used when fetching HTML and EPUB image resources in the form of a JSON string",
+        help="Specify http request headers used when fetching HTML and EPUB image resources in the form of a JSON string. They are only sent to the source document's origin, or to the origins given with --html-image-headers-origin.",
+    ),
+    html_image_headers_origins: list[str] = typer.Option(
+        None,
+        "--html-image-headers-origin",
+        help="Origin (e.g. https://cdn.example.com) allowed to receive --html-image-headers. Can be repeated. Replaces the default, which is the source document's origin.",
     ),

Source: GitHub Commit 5e46913. The patch introduces a new --html-image-headers-origin option so operators can explicitly list origins allowed to receive the configured headers, defaulting to the source document's origin only.

Detection Methods for CVE-2026-105742

Indicators of Compromise

  • Outbound HTTP requests from Docling worker hosts to domains not associated with trusted document sources, carrying Authorization or Cookie headers.
  • HTTP 3xx redirects observed in Docling processing logs where the redirect target differs from the original image host.
  • Unexpected authentication events on upstream APIs originating from Docling service IP ranges shortly after processing third-party documents.

Detection Strategies

  • Inspect installed Python package versions and flag any docling release between 2.95.0 and 2.131.x where remote image fetching is enabled.
  • Review Docling runtime configurations for enable_remote_fetch=True combined with populated HTMLBackendOptions.headers.
  • Correlate egress proxy logs with document ingestion events to identify requests to domains that were not part of the submitting document's origin.

Monitoring Recommendations

  • Route Docling egress through an authenticated forward proxy and alert on authentication headers sent to unknown destinations.
  • Rotate any API keys or cookies that were configured in HTMLBackendOptions.headers on vulnerable versions.
  • Enable structured logging around the HTML image loader and retain redirect chains for forensic review.

How to Mitigate CVE-2026-105742

Immediate Actions Required

  • Upgrade Docling to version 2.132.0 or later across all document processing workers.
  • Rotate every credential, API key, and cookie previously configured through HTMLBackendOptions.headers.
  • Audit historical ingestion jobs for untrusted documents processed with remote fetching enabled.

Patch Information

The fix is published in Docling v2.132.0 and tracked in GHSA-p3fw-7699-7926. The implementing change is pull request #4420, which validates every resolved address and scopes fetch headers to the source document's origin by default. Operators that need to send headers to additional hosts can enumerate them with --html-image-headers-origin.

Workarounds

  • Set enable_remote_fetch=False to prevent the HTML backend from issuing outbound requests.
  • Set fetch_images=False so image references in untrusted documents are not resolved.
  • Remove credentials from HTMLBackendOptions.headers until the upgrade is deployed.
bash
# Pin Docling to the patched release
pip install --upgrade "docling>=2.132.0"

# Restrict header forwarding to explicit origins (CLI example)
docling convert input.html \
  --html-image-headers '{"Authorization":"Bearer <token>"}' \
  --html-image-headers-origin https://cdn.example.com

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.