The security vulnerability GHSA-j4gv-6x9v-v23g is not in the primary OMERO.web application code but in a bundled third-party JavaScript library, jquery-form. The analysis of the patch commit a3eadf722cfada2b844b97abe65baf5856e77c4f reveals that the fix was to upgrade this library from a vulnerable version (4.3.0) to a patched version (4.3.1-custom).
The core vulnerabilities were identified within the jquery-form library's source code:
- Unsanitized HTML Injection: The
ajaxSubmit function, when used with a target option, would directly insert the server's response into the DOM using .html(). This allowed for Cross-Site Scripting (XSS) if the response contained malicious HTML. The patch introduces sanitization by processing the response with $.parseHTML and $.text().
eval() in JSON Parsing: The library contained a fallback parseJSON function that used the dangerous eval() function to process JSON strings. This could lead to arbitrary code execution if an attacker could control the server response. The patch removes this eval() call entirely.
Any part of the OMERO.web client that utilizes the jquery-form plugin for handling form submissions was susceptible. During an exploit, a profiler would show calls originating from the application's JavaScript, leading into the ajaxSubmit function of the jquery-form library, where the malicious data would be processed by the vulnerable code paths.