The vulnerability is a Server-Side Template Injection (SSTI) in the FreeMarker component of XDocReport. The analysis of the patch commit 3b35d105e5ae2006bcaa2b07563188efc466711d reveals that the fix involves hardening the FreeMarker configuration. Specifically, it sets the NEW_BUILTIN_CLASS_RESOLVER_KEY to "safer", which restricts the ability of templates to instantiate arbitrary classes, a common vector for SSTI in FreeMarker.
The code modification occurs in the setFreemarkerConfiguration method of the fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine class. This configuration is then used by the process method of the same class, which is responsible for rendering the templates. The added security test case, FreemarkerTemplateEngineSecurityTestCase.java, confirms that the process method is the entry point for the exploit, as it attempts to process a malicious template string. Therefore, the process method is the vulnerable function, as it's the one that executes the untrusted template code with an insecure configuration in vulnerable versions.