GitHub advisory · PyPI
Docling has SSRF guard bypass in remote resource fetching (DNS rebinding / multi-record resolution; no IP validation in HTML render mode)
PyPI
What it fixes
When remote fetching is enabled (enable_remote_fetch=True, together with fetch_images=True or HTML render_page=True), docling's protection against requests to private and loopback addresses can be bypassed.
http://127.0.0.1:8080\@1.1.1.1/x.png, the check validates 1.1.1.1 while the HTTP client connects to 127.0.0.1:8080.render_page=True), requests made by the page are allowed for any http(s) URL without an IP check.validate_url_safety in docling/backend/utils/image_resource_loader.py calls socket.gethostbyname(), which returns one IPv4 address. It checks that address and then passes the original URL string to requests, which parses it again with urllib3 and resolves the name independently through getaddrinfo. urllib.parse treats a backslash in the authority as part of the host section, while urllib3 ends the authority there, so the two can pick different hosts. This loader is shared by the HTML, Markdown, AsciiDoc, OpenDocument and JATS backends.docling/backend/html_backend.py routes browser requests in render mode. When enable_remote_fetch is set, it continues any http(s) request, including iframes and images, without resolving or checking the destination.JavaScript is disabled during rendering, so the browser path can only show internal responses passively in the page screenshot. It cannot read them and send them elsewhere.
enable_remote_fetch (CLI: --html-image-fetch remote or all) and process untrusted…Manual fix · PyPI
pip install --upgrade "docling>=2.132.0"pip install --upgrade "docling-slim>=2.132.0"Sources