KServe v2 OCR engine does not enforce enable_remote_services
Description
enable_remote_services is documented as the switch that must be turned on before docling sends document content to remote services, and docling raises OperationNotAllowed otherwise. The KServe v2 OCR engine (ocr_options.kind = "kserve_v2_ocr") does not check this flag. It sends page images to the configured endpoint even when enable_remote_services=False.
Details
- The KServe v2 object-detection and image-classification engines and the picture-description API model all check
enable_remote_servicesbefore making requests. - The OCR model in
docling/models/stages/ocr/kserve_v2_ocr_model.pydoes not. StandardPdfPipeline._make_ocr_modeldoes not pass the flag to the OCR factory.
The endpoint is the one configured by the caller. No attacker-controlled destination is involved.
Affected configurations
Callers that configure the KServe v2 OCR engine and rely on enable_remote_services=False as a policy control, for example a service that lets users choose OCR options but forbids remote processing.
Impact
Page images are sent to the configured remote endpoint despite remote services being disabled.
Patches
Fixed in docling 2.131.0 by #4418. The KServe v2 OCR engine now raises OperationNotAllowed unless enable_remote_services=True, like the other remote engines.
Workarounds
Upgrade to 2.131.0. For older versions:
Do not configure kserve_v2_ocr in environments where remote processing must be prevented. Validate user-supplied OCR options before passing them to docling.