The vulnerability allows for cross-site scripting (XSS) through the names and descriptions of tags and documents in Taguette. The root cause is the improper handling of user-supplied data when rendering the main project page. The analysis of the commits between the last vulnerable version (1.4.1) and the patched version (1.5.0) revealed a security fix in commit 9660f172c5f01bb4dd5c9871261bffb0d04e4704 with the message 'Escape HTML tags in embedded JSON'.
This commit modifies the taguette/web/views.py file, specifically within the Project.get method. Before the patch, this method used json.dumps to serialize project data, including potentially malicious strings, and then wrapped it with Markup to be embedded directly into the project.html template. This is unsafe as it allows for the injection of HTML tags, including <script> tags.
The patch introduces a new function, html_safe_json_dumps, which escapes the '<' character in the JSON output. This function is then used in Project.get to safely serialize the data. Therefore, the Project.get function is the vulnerable function as it is responsible for processing and rendering the malicious input. Any runtime profile during exploitation would show this function in the stack trace leading up to the rendering of the compromised page.