Jessica Entwistle
October 30 2026
Security researchers at PortSwigger have published research demonstrating that six of the eight most widely used SVG sanitiser libraries can be bypassed to execute JavaScript in a victim's browser. The research, published under the title "Scalable Vector Grief", shows how a response header can be used to trigger script execution in Firefox even when the response body contains entirely harmless-looking XML. The findings are significant because SVG sanitisers are specifically chosen to prevent cross-site scripting attacks in applications that accept user-uploaded or user-supplied SVG content, and the majority of the tools tested were found to fall short of that goal.
SVG file handling is a feature found across a wide range of web applications, including document editors, design and creative tools, marketing platforms, e-commerce systems, and content management systems. Development teams typically implement a sanitiser library as a trusted security control, often without ongoing scrutiny of whether that library remains effective as new bypass techniques emerge. The PortSwigger research demonstrates that in most cases, this trust may not be warranted. For UK organisations, the practical risk is that an attacker who can upload or inject an SVG file into an application may be able to execute JavaScript in the context of other users' sessions, potentially leading to account takeover, data theft, or further compromise. The fact that the bypass works even when the response body appears clean makes detection more difficult and means that content inspection alone is not a sufficient defence. Organisations that have completed penetration testing against their applications in the past should consider whether SVG handling was specifically tested, and whether the sanitiser library in use at the time has since been updated or changed.
Development and security teams should begin by identifying which SVG sanitiser library is in use across their web applications and checking whether it is among those found to be bypassable in PortSwigger's research. Where a vulnerable library is identified, teams should review whether updates or patches are available from the library maintainer and apply them promptly. It is also worth reviewing the broader approach to SVG handling: in some cases, restricting SVG uploads entirely or converting SVGs to a rasterised format on the server side may be a more robust control than relying on sanitisation. For organisations with externally facing web applications that accept file uploads, commissioning a targeted web application penetration test that specifically covers SVG handling would provide a clearer picture of actual exposure. This is also a useful prompt to review the process by which third-party security libraries are selected, monitored, and updated across the development estate.
Source: PortSwigger Research