Bug report: XSS vulnerability due to unescaped value in Show_Base64_offsets recipe
Description
On the latest version (10.24.0) of CyberChef there is an XSS vulnerability due to the unescaped staticSection (output of toBase64 with a user-controlled alphabet) in ShowBase64Offsets.mjs on lines 98, 128, and 158. When showVariable is false, the raw Base64 output is returned as HTML without escaping. Combined with the explicit eval() of <script> tags in OutputWaiter.mjs (line 373), this allows arbitrary JavaScript execution via a crafted URL.
To Reproduce https://gchq.github.io/CyberChef/#recipe=Show_Base64_offsets('%3Cscript%3Eale(1)/.ABCDEFGHIJKLMNOPQRSTUVWXYZbdfghjkmnoquvwxyz023456',false)&input=ABCDEFGHIJKDGLMNAOBCDEFGHPPP
Expected behaviour
staticSection should be passed through Utils.escapeHtml() before being included in the HTML output.
Fix released, thank you for your report! In the future, please note we would prefer security vulnerabilities to be responsibly disclosed inline with our security policy: https://github.com/gchq/CyberChef/blob/master/SECURITY.md