The vulnerability is a path traversal issue within the LaTeX processing functionality of the docling library. The advisory points out that the \includegraphics, \input, and \include commands were susceptible to this vulnerability. The issue was addressed in version 2.91.0.
By comparing the git tags between the last vulnerable version and the patched version, the commit 65ef18075fa8720a66aa0a2608313beb0844e2b4 was identified as the security fix, with the descriptive commit message "fix: prevent path traversal in LaTeX macro handlers".
The analysis of this commit reveals that the file docling/backend/latex/handlers/macros.py was modified. The function _process_macro within this file was updated to include path validation logic. Specifically, the patch introduces checks using Path.resolve().is_relative_to() to ensure that the file paths provided to the LaTeX commands do not resolve to a location outside of the document's base directory.
The vulnerable function is therefore _process_macro, as it is the function that processes the malicious input (the file path from the LaTeX command) and, prior to the patch, lacked the necessary sanitization, leading to the path traversal vulnerability. When a malicious document is processed, this function would appear in the runtime profile as it attempts to resolve and access the unauthorized file path.