The vulnerability is a stored Cross-Site Scripting (XSS) that stems from two combined weaknesses: logging unsanitized user input and rendering those logs without proper output escaping.
The investigation of the security patches identified two key commits that address this vulnerability. The first commit, 9066e10326029adf012114e27eb5f3f33f78ecfd, patches several functions (auth, changePasswordAction, send) that were logging raw user-provided data. It does so by wrapping the user input with htmlspecialchars before it is written to the log. This prevents malicious HTML from being stored in the first place.
The second and most critical commit, 2afd98cecd26c5f8357e0e321d86063ad1012fc3, fixes the root cause of the XSS rendering. It removes the |raw filter within the Core/View/Macro/Utils.html.twig template. This Twig filter explicitly disables output escaping, which allowed the stored malicious scripts to be executed in the browser of anyone viewing the logs (e.g., the "History" tab).
The vulnerability described in the report, involving the "Observations" field, is an instance of this general pattern. A controller responsible for saving delivery notes was logging the content of the "Observations" field without sanitization. When the history for that note was viewed, the vulnerable Twig macro would render the log entry, executing the attacker's script. The functions identified above are also part of this vulnerable pattern, as they processed potentially malicious input that was rendered in the same insecure way.