flawopen.com/Teardowns/cve-2026-105751-docling-odf-file-disclosure
CVE-2026-105751: Docling ODF फ़ाइल प्रकटीकरण
Docling का ODF backend दस्तावेज़ में मौजूद image reference को local path मानकर archive के बाहर की फ़ाइल पढ़ सकता था। 2.120.3 पर upgrade करें; सुधार साझा resource-control component से loading कराता है।
CVSS वेक्टर
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:L/SI:N/SA:Nएक लाइब्रेरियन एल्बम के अंदर तस्वीर खोजता है। तस्वीर न मिलने पर दोषपूर्ण reader एल्बम के लेबल पर लिखे path से फाइलिंग कैबिनेट खोल देता है, और local files न लाने का पुस्तकालय नियम नहीं जाँचता। सुधार reader को वही सुरक्षित resource desk इस्तेमाल कराता है जो दूसरे document formats करते हैं।
इस पेज के मुख्य शब्द
OpenDocument Format (ODF)- ऑफिस दस्तावेज़ों का format परिवार, जिसमें .odt text files शामिल हैं। Docling document XML से image references पढ़ता है।
draw:image- चित्र बताने वाला ODF XML element। इसका xlink:href resource बताता है।
xlink:href- ODF image element में resource reference। यह document input है, filesystem authorization का निर्णय नहीं।
ImageResourceLoader- Docling का साझा image loader। यह local और remote fetch विकल्प, path handling और remote URL सुरक्षा जाँच लागू करता है।
enable_local_fetch- यह विकल्प बताता है कि समर्थित backends local image resources fetch कर सकते हैं या नहीं। Shared loader को bypass करने वाला backend इस control को भी bypass करता है।
फ्रेमवर्क मैपिंग
- इस गाइड में बताई गई कमजोरी के लिए CWE संदर्भ: CWE-22
मूल कारण विश्लेषण (Root Cause)
प्रभावित Docling versions में _image_ref_from_odf_image() पहले ODF archive के अंदर draw:image resource ढूँढ़ता था। खोज से bytes न मिलने पर fallback document-controlled xlink:href को सीधे Path में बदलता और path मौजूद होने पर read_bytes() चलाता था। इससे shared ImageResourceLoader bypass हुआ: ODF processing ने enable_local_fetch, enable_remote_fetch या साझा resource-resolution rules लागू नहीं किए। Image-type filter खाली suffix भी स्वीकारता था, जिससे बिना extension वाले paths आ सकते थे। Image decoding से पहले file read हो सकती है; यदि bytes image के रूप में decode हों, तो परिणामी document में disclosure भी प्रमाणित है। Vendor advisory local files के arbitrary read और Docling output formats में image-content disclosure दर्ज करती है; दूसरा प्रभाव केवल decode हो सकने वाले image data तक सीमित है। यह CVE ऐसे supplied document की conversion से जुड़ा है जिसे local files पढ़ सकने वाला process संभालता है; इससे यह सिद्ध नहीं होता कि हर Docling deployment network से reachable है। Fix external references को local base path के बिना ImageResourceLoader.load_image_data() में भेजता है, ODF traversal में loader आगे पहुँचाता है, और स्वीकार्य image extensions से खाली suffix हटाता है। Shared loader default रूप से local fetch रोकता है और उसे enable करने पर confined base path माँगता है। GitHub CNA ने CVSS 4.0 6.9 Moderate (UI:A) दिया है; अतिरिक्त reachable service और conversion path के बिना इसे unauthenticated remote exploitation न कहें।
हमले का चरण-दर-चरण प्रवाह
दस्तावेज़ ODF conversion path में आता है
संबंधित input एक OpenDocument file है जिसे Docling 2.107.0 से 2.120.2 तक process करता है। समस्या ODF image backend में है, सभी Docling formats या सभी HTML/RAG integrations में नहीं।
Image reference document XML से आता है
ODF का draw:image element xlink:href देता है। Docling पहले archive के अंदर resource खोजता है।
Archive में न मिला भाग host path पर चला जाता है
Archive lookup विफल होने पर vulnerable helper उसी reference को Path मानकर सीधे पढ़ता था। Fallback shared local-fetch setting नहीं जाँचता और path को archive तक सीमित नहीं करता।
Docling bytes को image resource के रूप में process करता है
Filesystem read image decoding से पहले होती है। Supported image होने पर bytes DoclingDocument और HTML, Markdown या JSON export में शामिल हो सकते हैं।
Fixed loader resource boundary बहाल करता है
Docling 2.120.3 external ODF references को ImageResourceLoader के जरिए भेजता है, local base path नहीं देता और extension-विहीन references हटाता है। अविश्वसनीय documents convert करते समय local fetch बंद रखें।
सोर्स कोड: कमज़ोर बनाम सुरक्षित कार्यान्वयन
ये upstream code के चुने हुए excerpts हैं, standalone patch नहीं। Fix backend के enable_local_fetch और enable_remote_fetch options के साथ ImageResourceLoader बनाता है, उसे ODF processing में देता है और external references को उसी से load कराता है। base_path=None होने पर local fetch स्पष्ट रूप से enable करने पर भी local paths अस्वीकृत होते हैं, क्योंकि loader confined directory तय नहीं कर सकता। Patch खाली image suffix भी अस्वीकार करता है। केवल यह excerpt copy करने के बजाय 2.120.3 या बाद के version पर upgrade करें।
सोर्स अंश: docling/backend/opendocument_backend.py — स्रोत कोड का केंद्रित अंश
# Archive में resource न मिलने पर document द्वारा दिया गया path पढ़ा जाता था।
if image_data is None and image_url:
image_path = Path(image_url)
if image_path.is_file():
image_data = image_path.read_bytes()
# Fixed path: backend options के साथ shared loader इस्तेमाल करें।
if image_data is None and image_url and image_loader is not None:
image_data = image_loader.load_image_data(image_url, base_path=None)
इंजीनियरिंग और सिस्टम सुरक्षा चेकलिस्ट
- ✓docling को 2.120.3 या बाद के version पर upgrade करें और transitive document-processing services सहित runtime में installed package version verify करें।
- ✓ऐसी pipelines की सूची बनाएँ जो untrusted .odt, .ods या .odp files स्वीकारती हैं; पहचानें कि conversion process किन OS files को पढ़ सकता है।
- ✓Untrusted documents के लिए enable_local_fetch बंद रखें; vulnerable versions में यह shared loader को bypass करने वाले ODF path को सुरक्षित नहीं करता।
- ✓Conversion को least-privilege identity, न्यूनतम read-only filesystem view और parser process में secrets mount किए बिना चलाएँ।
- ✓Custom backends में document-provided paths सीधे खोलने के बजाय shared ImageResourceLoader इस्तेमाल करें; local resources से पहले trusted base directory अनिवार्य करें।
- ✓Disposable canary files के साथ archive-contained images, missing archive references, extension-विहीन references, absolute paths और local-fetch on/off के regression tests जोड़ें।
- ✓Verify करें कि outputs में केवल अपेक्षित document assets हों; सफल conversion यह साबित नहीं करती कि कोई दूसरी file नहीं खोली गई।
- ✓यदि प्रभावित service ने untrusted ODF files process की हों, तो logs और outputs में अप्रत्याशित image data जाँचें और समीक्षा को service account से readable files तक सीमित रखें।