Summary
Docling's HTML backend previously handled URIs and file paths in an unsafe way when processing documents from diverse formats.
Under certain conditions, attackers can abuse this path handling to access or manipulate unintended resources, making deployments that process untrusted documents particularly risky.
Affected context
This vulnerability affects environments where Docling is used to parse and convert documents into HTML, especially when inputs originate from external or semi‑trusted sources.
It is most relevant in workflows that automatically ingest user‑supplied files, URLs, or embedded links and then rely on Docling to resolve paths or URIs without additional validation.
Systems that run Docling with broad filesystem visibility or network access are more exposed because unsafe path resolution can reach resources beyond the intended document scope.
Exploit preconditions
- Attack surface: Docling HTML backend invoked during document parsing and HTML generation.
- Required access: Ability to supply or influence documents, embedded links, or URIs that Docling processes.
- Trigger point: Resolution of file paths or URIs when the HTML backend interprets document references or includes external content.
- Why exploitation is possible: Path and URI handling lacks sufficient normalization and enforcement of allowed locations or schemes, enabling crafted inputs to direct Docling toward unintended files or resources.
Why this happens
The core issue stems from improper control over file and directory access when resolving paths and URIs, aligning with CWE-73: External Control of File Name or Path.
Docling's HTML backend appears to trust document‑provided references without strictly constraining resolution to a safe subset of locations, allowing external input to influence what files or resources are accessed.
In some scenarios, repeated or unconstrained resolution of such references can also lead to excessive resource consumption, touching on CWE-400: Uncontrolled Resource Consumption, if large numbers of paths or remote resources are processed.
Potential impact
- Access to files or directories outside the intended document processing scope may occur.
- Attackers could read or include sensitive local resources into generated HTML content.
- Workflows can be manipulated to process excessive or unintended remote resources, which could cause performance degradation.
- Document pipelines integrating with generative AI systems may receive poisoned or unauthorized content, affecting downstream models and outputs.
General mitigation guidance
Mitigation typically involves constraining and validating all file paths and URIs that Docling's HTML backend can resolve, reducing trust in document‑supplied references.
Common defensive patterns include:
- Restricting path resolution to a whitelisted root directory or sandboxed storage area.
- Enforcing strict URI scheme and host allow‑lists, rejecting or stripping unexpected schemes and locations.
- Normalizing and canonicalizing paths before use, and blocking traversal outside permitted directories.
- Applying resource limits, timeouts, and request caps when resolving any external resources referenced in documents.
- Running document processing components with least‑privilege filesystem and network permissions so that even misrouted paths have minimal impact.
How teams detect issues like this
Detection efforts can focus on how Docling and related pipelines handle file paths and URIs during HTML generation.
Useful strategies include:
- Static analysis rules that flag code paths where user‑controlled strings are used directly in file or network access APIs without normalization or access checks.
- Code reviews that look for missing allow‑lists, unchecked path concatenation, and direct use of document data in resource resolution logic.
- Logging and monitoring of document processing activity for unusual access patterns, such as attempts to reach sensitive directories or unexpected external hosts.
- Policy enforcement in CI/CD to require safe path handling patterns and resource limits in libraries that perform document parsing and HTML generation.

