{"id":26188,"date":"2026-09-21T15:14:22","date_gmt":"2026-09-21T23:14:22","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2026\/09\/21\/hidden-in-plain-sight-how-svgs-carry-malicious-scripts\/"},"modified":"2026-09-21T15:14:22","modified_gmt":"2026-09-21T23:14:22","slug":"hidden-in-plain-sight-how-svgs-carry-malicious-scripts","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2026\/09\/21\/hidden-in-plain-sight-how-svgs-carry-malicious-scripts\/","title":{"rendered":"Hidden in plain sight: How SVGs carry malicious scripts"},"content":{"rendered":"<div class=\"rich-text_richText__UyrDZ\" data-anchor-headings=\"true\" data-component=\"rich-text\" data-reader-view=\"false\">\n<div class=\"payload-richtext\">\n<p>In early 2026, sources began reporting an uptick in SVG based malware. SVG, standing for scalable vector graphics, is a filetype usually utilized to create vector images. SVGs are special due to their ability to utilize Javascript. <\/p>\n<p>Threat actors use this functionality to craft SVG files that can act maliciously. Malicious SVGs can take the form of fake login pages, data exfiltrators, or malicious downloaders, amongst other things. SVGs are frequently overlooked, as they are assumed to be benign images, leaving a gap in security architecture.\u00a0<\/p>\n<p>SVGs are difficult to detect, can easily be snuck into emails or webpages, and are able to perform malicious and legitimate actions simultaneously. Many security solutions do not account for malicious SVGs, seeing them only as images. Here&#8217;s how they work.<\/p>\n<h2 id=\"what-is-an-svg\">What is an SVG?<\/h2>\n<p>SVGs are a versatile and widely used image format. Originally proposed in 1994, they became the World Wide Web Consortium\u2019s top choice for an open standard for web-based vectors in 1999, and started being mass adopted around the 2010s. Vector images scale without compression artifacts, looking good no matter the size, making them useful in a variety of situations. <\/p>\n<p>They rely on writing out formulas to generate the images, as opposed to mapping specific colored pixels to specific areas (bitmap), like PNGs or JPEGs do. They <a href=\"https:\/\/huseynov.com\/obfuscated-svg-malware-a-deep-dive-into-a-stealthy-redirection-attack-bb0bb87d4b6e\"><span style=\"text-decoration:underline\">keep their text embedded within them<\/span><\/a>, allowing for the contents to be searchable, aiding in <a href=\"https:\/\/www.shopify.com\/blog\/what-is-a-svg-file\"><span style=\"text-decoration:underline\">search engine optimization<\/span><\/a>, or for image creators to include descriptions and comments. They\u2019re written in XML, creating unique opportunities for interaction with certain applications. <a href=\"https:\/\/www.shopify.com\/blog\/what-is-a-svg-file\"><span style=\"text-decoration:underline\">There are many programs that can be used to generate these files<\/span><\/a>, and there is also the possibility to hand write them if one understands the syntax.\u00a0<\/p>\n<p>Due to the XML based nature of SVGs, it is possible to embed Javascript with SVG files. On paper, the intended use of this feature would be to foster interactive assets or create animation, although more elaborate functions are possible. Unfortunately, Javascript is being used by malware authors to turn these seemingly harmless files into weapons. Most do not consider images when they\u2019re thinking about malicious filetypes, but they can be used for various attacks. In most browsers, embedded <a href=\"https:\/\/huseynov.com\/obfuscated-svg-malware-a-deep-dive-into-a-stealthy-redirection-attack-bb0bb87d4b6e\"><span style=\"text-decoration:underline\">Javascript will execute as a default<\/span><\/a>, leaving unaware users and organizations vulnerable.\u00a0<\/p>\n<p>Malicious SVGs can be categorized into <a href=\"https:\/\/www.cloudflare.com\/cloudforce-one\/research\/svgs-the-hackers-canvas\/#svgs-injecting-malicious-code-into-the-host-page-dom-clobbering-\/-script-injection\"><span style=\"text-decoration:underline\">three different kinds of attack<\/span><\/a>: Redirector, self-contained phishing, and DOM injection\/script abuse. Redirectors are the most simple, and are SVGs used to redirect users to a different site where the actual compromise takes place. Sometimes, users click an image they can\u2019t even see to be redirected. Other times, users may be encouraged to click the image, opting into the redirect more overtly. <\/p>\n<p>The secondary site may contain a malicious payload or be a phishing site. The secondary type of SVG attack is self-contained phishing pages. These will use SVG\u2019s HTML, CSS and Javascript capabilities to create phishing pages and extract credentials. Finally, the scripts in SVGs can very directly cause harm. DOM abuse leads to cross-site scripting (XSS) effects, or the Javascript itself executes malicious commands.\u00a0<\/p>\n<p>While they seem like an unusual vector, SVGs have the advantage of being difficult to detect. They can easily be snuck into emails or webpages, and are able to perform malicious and legitimate actions simultaneously. Many security solutions do not account for malicious SVGs, seeing them only as images.<\/p>\n<h2 id=\"examples-from-the-wild\">Examples from the wild<\/h2>\n<p>Recently, ReversingLabs examined a pool of recent, malicious SVG files. Multiple trends were observed, showing off facets of the aforementioned attack types. The following covers descriptions of these kinds of attacks, to show how they work in practice.<\/p>\n<h3>Self-contained script abuse website<\/h3>\n<p>This is an example of an SVG that acts as a website, including external links and a surprise Javascript payload to execute. There are multiple variations on this website, with content in a variety of languages, but the sites remain similar. The SVG encodes the entire webpage, and keeps the formatting consistent throughout. All webpages report to have the same company behind them, write extensively about online gambling, and even a link to the same personal photography blog. The website has a search function which does send the inputs to a server, but the webpage does not seem to change or redirect from its use. <\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:1e\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 1.1, Screenshot of webpage with several paragraphs of writing about online gambling.<\/em><\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:1f\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 1.2, Screenshot of webpage, with (non functional) links to some information on WordPress, as well as contact information for WordPress services.<\/em><\/p>\n<p>The most interesting piece of the website is this block of Javascript:<\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:20\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 1.3 shows a block of Javascript.<\/em><\/p>\n<p>This is doing a few things. For one, it\u2019s generating an ID for the user. It\u2019s also sending back the inputs from the search bar to the website pinche[.]php. The script calling to the chx[.]js domain is the scary part. This domain is associated with an attack most prominent in 2024 to force victims&#8217; browsers into brute-forcing passwords on WordPress sites. Using the Internet Archive, it can be determined that this domain went through a lot of changes throughout the time of the peak of this exploit, and still was sporadically changing throughout 2025.<\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:21\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 1.4. Screenshot of Internet Archive of activity for the webpage containing the brute force function script(chx[.]js), showing large spikes in activity in the beginning of 2024 and moderate activity throughout 2025.<\/em><\/p>\n<p>The domain contains a script for doing the brute force function, while calling to another page for a password list. While this script isn\u2019t directly coded in the SVG, it\u2019s being used by being called through this URL.<\/p>\n<p>This example shows both the potential of SVGs to act as a webpage as well as perform XSS. While it does not act as a self contained phishing page, it shows how an SVG file can act as a webpage, and utilize event listeners to exfiltrate inputs. Styled in a different way, this could mimic legitimate pages, and deceive users into entering their credentials.<!-- --> <\/p>\n<h3>Redirector voicemail attachments<\/h3>\n<p>In contrast to the 2024 WordPress abuse, 2026 has shown a flood<a href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2026\/04\/30\/email-threat-landscape-q1-2026-trends-and-insights\/\"><span style=\"text-decoration:underline\"> of spear phishing attempts<\/span><\/a> utilizing SVGs as fake voicemail attachments. Voicemails act as a way to redirect users from\u00a0<\/p>\n<p>In the samples analyzed by ReversingLabs, SVG attachments appeared to be designed to masquerade as fake voicemail attachments. Many of them have specific emails, sometimes encoded in base64 but sometimes being plaintext, suggesting spearphishing attempts. The targets range from general department contacts (administrative or financial), to specific individuals of importance (CEOs, financial managers, and more). They primarily target industries related to healthcare, construction and banking. <\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:22\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 2.1, screenshot of the first portion of a redirector SVG. A base64 encoded email address for the administrative department of an engineering firm is blacked out.<\/em><\/p>\n<p>The files observed still follow the legacy of overall trends. What is especially fascinating is the sheer variety of these types of files. While there are swaths of samples that are almost identical, save for the different target emails encoded within them, many samples are vastly different. Some have comments in the file indicating use of image generators like Libre Office or Inkscape. A variety of languages were observed, with some comments or user-side text\u00a0 in Spanish and Russian. Certain samples also had the excessive commenting indicative of AI generated code.<\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:23\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 2.2, Example comment on file<\/em><\/p>\n<p style=\"text-align:center\">Most files do not contain anything to actually create images, only the malicious Javascript utility.<\/p>\n<div class=\"rich-media_container__AH6jG media-block_mediaBlock__nZBDJ\" data-position=\"center\" data-restrict=\"true\" data-size=\"fill\">\n<div class=\"rich-media_media__trppT\"><template id=\"P:24\"><\/template><\/p>\n<div class=\"rich-media_overlay__LSRfe\"><svg aria-hidden=\"true\" class=\"lucide lucide-expand\" fill=\"none\" height=\"24\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewbox=\"0 0 24 24\" width=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"m15 15 6 6\"><\/path><path d=\"m15 9 6-6\"><\/path><path d=\"M21 16v5h-5\"><\/path><path d=\"M21 8V3h-5\"><\/path><path d=\"M3 16v5h5\"><\/path><path d=\"m3 21 6-6\"><\/path><path d=\"M3 8V3h5\"><\/path><path d=\"M9 9 3 3\"><\/path><\/svg><\/div>\n<\/div>\n<\/div>\n<p style=\"text-align:center\"><em>Figure 2.3, Example file, email is in plaintext and malicious domain is encoded, with no scripts for image creation.<\/em><\/p>\n<p>The attackers use a variety of encoding methods to obfuscate the redirect domains, including breaking up the code and piecing it back together when run. The files researchers deobfuscated all were redirectors,but other types of malicious behavior may be present. Researchers extracted potentially malicious domains by decoding the payload, but were unable to access their contents. These domains are <em>01058telecom[.]de<\/em>, <em>qedhsp[.]cprltdf[.]es<\/em> and <em>wihportal[.]sbs<\/em>.\u00a0<\/p>\n<h2 id=\"a-novel-approach\">A novel approach<\/h2>\n<p>As a file format typically reserved for images, SVGs act as a novel way to perpetuate malicious actions. SVGs are used all across the internet, and while their Javascript capabilities can be benign, they can also be exploited. This exploitation turns an assumed to be harmless file into something dangerous. In order to ensure the safety of your organization, it is advised to filter emails with SVG attachments, and to maintain diligence of what you click on. Other anti-phishing protection methods can also help, like OTPs, FIDO keys, and more. A lot of SVG attacks end up redirecting to or directly acting as credential harvesting phishing sites, and this acts as another reason to enforce anti-phishing measures. SVGs cannot be treated as something benign, and organizations must be proactive at mitigating their harm.<\/p>\n<h2 id=\"indicators-of-compromise-iocs\">Indicators of Compromise (IOCs)<\/h2>\n<p><strong>URLs:<\/strong><br \/><em>01058telecom[.]de<\/em><br \/><em>Wihportal[.]sbs.<\/em><br \/><em>qedhsp[.]cprltdf[.]es<\/em>\/<\/p>\n<\/p>\n<p><strong>Hashes:<\/strong><br \/><em>d9e4ae7bf23b5c6691156a6fa7fb128ea6890584<\/em><br \/><em>0d289ae3837acc7d076b770b6cec2a1d8b0fabf0<\/em><br \/><em>d632cad92dd560374eef427930cbef562b309067<\/em><br \/><em>c5329cfae6d94b2ba9dddaa20b1725a51104581c <\/em> <br \/><em>771151e26a5e7d3198d3b28a919e802965482d39<\/em> <br \/><em>effcc8433a07fb9e1b1cc2efa621487d62315177<\/em> <br \/><em>31652250f9e4f67579a3e187806ba2cfad1792db<\/em> <br \/><em>2b081fb89d88c93ee5339d33eb3200b69d5f3b8b<\/em><br \/><em>806d8283de91c116f2c56ad0aa4c7ae0b33de626\u00a0\u00a0<\/em><br \/><em>5fa626b691613abbcc0eed2d143c3a485853d8d9\u00a0\u00a0<\/em><br \/>139ec3c1b4fae48fc5d6e0d4957516f0c20633f3<br \/><em>97f5bfb2f8c2aa240d52345c54ef2e99b760c16e<\/em><br \/><em>3734b0314f01293b36efb9fbff133a332ab9d6b0\u00a0\u00a0<\/em><br \/><em>177122bdcc5dc1ddd38a01c68b4b7c627c7a50b0<\/em><br \/><em>955dbf23d53832f5f1c514b116a5cc04ccc635ec<\/em><br \/><em>cb53af4fbf24936590f5092f717661d3579d50de<\/em><br \/><em>df9582a020b87af2ab67aeeb9cd48e63a1c7fa3e<\/em><br \/><em>7d4daac63543a754ee43cfc4e812040e6ed32ac9\u00a0\u00a0<\/em><br \/><em>e01739c067950beb1a877b54401ae2a47962b61c<\/em><br \/><em>bf978f20fd2320645bda61a78ef7d652130394a1<\/em><br \/><em>2b48a6c9cfb3932021c7c4b567199f57802ad018<\/em><br \/><em>eec21fc0c0163117039b1cc2a9209ade788f4d64<\/em><br \/><em>997ca1f4d9e94293ddaed0a63968fd25c19e8a6c <\/em><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In early 2026, sources began reporting an uptick in SVG based malware. SVG, standing for scalable vector graphics, is a filetype usually utilized to create vector images. SVGs are special due to their ability to utilize Javascript.Threat actors use this functionality to craft SVG files that can act maliciously. Malicious SVGs can take the form of fake login pages, data exfiltrators, or malicious downloaders, amongst other things. SVGs are frequently overlooked, as they are assumed to be benign i<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[32775],"tags":[],"class_list":["post-26188","post","type-post","status-publish","format-standard","hentry","category-reversinglabs"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/26188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=26188"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/26188\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=26188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=26188"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=26188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}