That .svg file in your inbox is not an image: how weaponized SVG phishing steals logins
A coworker in our finance team almost lost her Microsoft 365 account last month. The email looked routine: sender display name "Compensation & Benefits Unit," a subject about a pending document to sign, attachment named invoice.svg. She double-clicked it out of habit. Her browser opened what looked exactly like a Microsoft login page, with her work email already filled in and a red button pushing her to "verify." She only stopped because her phone buzzed with a login code she had not requested. That pause saved her.
After she told me, I went digging, and realized how wrong most of us are about what an SVG actually is.
SVG is not a picture, it is XML that can run code
SVG stands for Scalable Vector Graphics. Unlike a PNG or JPG, which is just compressed pixel data, an SVG is a text file written in XML. And XML can carry <script> blocks, embedded HTML forms through <foreignObject>, and links to remote resources. When a browser renders that file, the script runs. It can pop a credential-harvesting form, redirect you to a look-alike login page, or quietly pull a remote image that tells the attacker "this person just opened it, from this device, on this network."
Security researchers call these "weaponized SVGs." The numbers jumped fast in 2025. Kaspersky said SVG-phishing emails rose nearly sixfold in March 2025 versus the prior month and that it had spotted more than 4,000 such messages since the start of the year; some impersonated e-signature services and opened a fake Microsoft form. Trustwave pegged the growth at roughly 1,800% from early 2024 to April 2025. Hoxhunt found SVG's share of phishing attachments climbed from about 0.1% in 2024 to 4.9% in the first half of 2025, peaking near 15% in March, roughly one in seven phishing attachments that month.
The tells (what my coworker's email got wrong)
The trick works because we assume "it's an image, so it's safe." Her message had gaps in hindsight:
- The display name said "Compensation & Benefits Unit" but the signature read "Billing | Finance Team" - a mismatch.
- The attachment was invoice.svg while the body called it a "PDF file."
- It demanded a password on open and pre-filled her email; real e-signature tools do not do that.
- The page behind the link sat on an obscure country-code domain, not her company's real one.
The NJCCIC documented the same playbook: a "salary adjustment voicemail" lure with an unnamed SVG attachment that, when clicked, dropped and ran a download.js. IBM X-Force tracked a heavier campaign through 2025 aimed at financial institutions, spoofing SWIFT and using the SVG's embedded script to write a ZIP to disk; inside was a Java loader that deployed remote-access trojans like Blue Banana and SambaSpy and exfiltrated Outlook mail through Telegram bots. Microsoft itself stopped rendering inline SVG in the new Outlook from September 2025, the vendor effectively admitting the format is too risky to show by default.
The quieter risk: tracking beacons
Even without a fake login page, an SVG can call back to an attacker's server through an embedded <image> or external font. Every open becomes a read-receipt plus a device fingerprint. There is also the "Billion Laughs" XML entity-expansion trick, where a few kilobytes expand into gigabytes of memory and freeze a parser.
How to stay safe without losing the file
Treat any untrusted SVG as active code, not a static picture.
First, block .svg attachments at the mail gateway where you can. Microsoft's move to stop inline rendering is the right instinct.
Second, if you actually need to see what the image is, do not open it in a browser and do not hand it to a random free online converter. Those sites can inject their own scripts, and they now hold your file, machine paths, software license strings, hidden draft layers, which can end up in someone's AI training set.
What I do now: run the SVG through a local SVG-to-WebP converter on my own machine. Rasterizing the vector into a flat bitmap throws away the <script>, the event handlers, and the external references. The WebP that comes out is pure pixels, with no executable code, so I can see the original artwork without triggering anything, and the file never leaves my computer.
🛠SVG to WebPUse this tool in Antpact Toolbox →
FAQ
I got a .svg attachment. What now? Do not double-click it in a browser. Verify the sender through a known phone number, not the email's links. When in doubt, treat it as a high-risk attachment and delete it.
Are PNG and JPG safer than SVG? Yes. They are pixel data with no scripting surface, so they cannot execute code. For images in email, PNG or JPG is the safe default; treat SVG as code.
Can I use an online SVG converter? You can, but you are uploading the source file to someone else's server. For proprietary or sensitive artwork, rasterize locally so the file never leaves your machine.
How do I tell if an SVG is malicious? Most people cannot read the XML by eye. The safe habit is to never open unknown SVGs in a browser; if you must inspect the content, rasterize it to an image locally first.