---
title: "SVG: The Image That Runs Script: Why a Vector Graphic Is Also a Web Page"
description: An SVG logo can carry JavaScript that runs under the address of the site that serves it. Winter Vivern used this against Roundcube webmail.
image: https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg
---

[customer login](https://www.bowbridge.net/customer-portal/) english deutsch

[![bowbridge](https://explore.bowbridge.net/hubfs/logos/bowbridge_logo.svg "bowbridge")](https://www.bowbridge.net/en/)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

- [DE](https://www.bowbridge.net/de/)
- [EN](https://www.bowbridge.net/en/news.html)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

![File Security 101 – Threats Beyond Malware](https://explore.bowbridge.net/hs-fs/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg?width=1800&height=500&name=File%20Security%20101%20-%20Blog%20Header.jpeg)

# SVG: The Image That Runs Script: Why a Vector Graphic Is Also a Web Page

Nov 23, 2026, 3:50:32 PM by Joerg Schneider-Simon

An SVG file looks like a picture, but a browser treats it as a document that may contain JavaScript, and runs that script on the site that shows it. This is episode 11 of File Security 101, our series on file-based threats your anti-malware does not see.

<iframe class="hs-responsive-embed-iframe" src="https://www.youtube.com/embed/UtJ8LUUsQ6k?rel=0" title="File Security 101 – Ep 11 – SVG – The Image That Runs Script – How it works" style="position:absolute;top:0;left:0;width:100%;height:100%;border:none;" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

The video explains it in about two minutes.  
 The article adds the details and the research behind it.

## A logo that is also a page

Logos, icons and diagrams are often delivered as SVG (Scalable Vector Graphics). Unlike a PNG or JPEG, an SVG contains no pixels. It is a text file in XML that describes shapes, paths, colors and text, and the viewer draws them at any size. That makes SVG popular for brand assets, and many portals, ticket systems and content management systems accept it wherever they accept images.

## XML with a script engine

The SVG standard is designed for the web, and it shares the browser's scripting model. An SVG may contain a `<script>` element, event handler attributes such as `onload`, `onclick` or `onerror`, and links whose target starts with `javascript:`. How much of this runs depends on how the file is shown. When a page embeds the SVG with an `<img>` tag, browsers do not run its scripts. When the browser opens the SVG itself, for example through a direct link, or when it is placed inline in a page, the browser treats it as a document and executes the script.

## The attack: the portal runs it

The attacker uploads an SVG with a script to a site that accepts images, such as a company portal. The site stores the file and serves it from its own address. Anyone who opens the image link runs the script under that address. For the browser's same-origin rules, the script is part of the portal: it can read the pages of the portal, send requests with the visitor's logged-in session and pass data to the attacker's server. This is stored cross-site scripting, delivered as an image.

## It happened

- **Roundcube, 2023.** ESET found that the group Winter Vivern began exploiting a zero-day in Roundcube Webmail on October 11, 2023. A crafted email contained an SVG element whose `<image>` had an invalid `href`, so its `onerror` handler ran Base64-decoded JavaScript. "No manual interaction other than viewing the message in a web browser is required." The final payload listed the victim's folders and emails and sent the messages to the attackers' server. Roundcube released fixed versions 1.6.4, 1.5.5 and 1.4.15 on October 16, 2023 ([ESET](https://www.welivesecurity.com/en/eset-research/winter-vivern-exploits-zero-day-vulnerability-roundcube-webmail-servers/)). The flaw, [CVE-2023-5631](https://nvd.nist.gov/vuln/detail/CVE-2023-5631), is in CISA's Known Exploited Vulnerabilities catalog.
- **Qakbot, 2022.** Cisco Talos described phishing emails with HTML attachments that embedded an SVG with `<script>` tags. The JavaScript assembled a password-protected ZIP archive on the victim's computer; it contained an ISO file associated with a Qakbot infection ([Cisco Talos](https://blog.talosintelligence.com/html-smugglers-turn-to-svg-images/)).

MITRE ATT&CK lists the technique as [T1027.017, SVG Smuggling](https://attack.mitre.org/techniques/T1027/017/): malicious JavaScript in SVG files, used to assemble payloads, redirect users or show fake login forms.

## Why it slips through

This file does contain code, so why does it get through? Upload checks typically look at the file type and the image dimensions, and a valid SVG passes both. The script is ordinary text in elements and attributes the standard allows, and it is often encoded, as the `eval(atob(...))` in the Roundcube exploit shows. Each campaign can change the encoding and the wording, so signature-based detection has to catch up with every variant. And users, like many filters, see an image, not a page.

## What to do

- If your application accepts uploads, convert SVG to a raster image such as PNG, or serve user-supplied SVG only as a download (`Content-Disposition: attachment`) from a separate domain, never as a page from your main domain.
- Add a restrictive Content Security Policy to responses that serve user files.
- Keep webmail and portal software up to date; Roundcube's fix was available five days after exploitation began.

bowbridge Content Disarm and Reconstruct rebuilds an SVG from an allow-list of drawing elements and attributes: shapes, paths, colors and text. Script elements, event handlers and script links are not on that list, so they are not carried over, and the report counts what was left out.

[Join the bowbridge CDR beta program](https://explore.bowbridge.net/en/cdr-beta)

## Sources

- [Winter Vivern exploits zero-day vulnerability in Roundcube Webmail servers](https://www.welivesecurity.com/en/eset-research/winter-vivern-exploits-zero-day-vulnerability-roundcube-webmail-servers/), ESET (Matthieu Faou), October 25, 2023
- [CVE-2023-5631](https://nvd.nist.gov/vuln/detail/CVE-2023-5631), National Vulnerability Database
- [HTML smugglers turn to SVG images](https://blog.talosintelligence.com/html-smugglers-turn-to-svg-images/), Cisco Talos, December 13, 2022
- [T1027.017: Obfuscated Files or Information: SVG Smuggling](https://attack.mitre.org/techniques/T1027/017/), MITRE ATT&CK

## Subscribe to upcoming episodes

#### Share this on social:

[Share via LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-11-svg-the-image-that-runs-script&title=SVG%3A+The+Image+That+Runs+Script%3A+Why+a+Vector+Graphic+Is+Also+a+Web+Page&summary=An+SVG+logo+can+carry+JavaScript+that+runs+under+the+address+of+the+site+that+serves+it.+Winter+Vivern+used+this+against+Roundcube+webmail.) [Share via Twitter](https://twitter.com/intent/tweet?url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-11-svg-the-image-that-runs-script&text=SVG%3A+The+Image+That+Runs+Script%3A+Why+a+Vector+Graphic+Is+Also+a+Web+Page) [Share via Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-11-svg-the-image-that-runs-script) [Share via Email](mailto:?subject=SVG%3A+The+Image+That+Runs+Script%3A+Why+a+Vector+Graphic+Is+Also+a+Web+Page&body=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-11-svg-the-image-that-runs-script)

### Don't miss the latest SAP security news

#### bowbridge

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/)
- [About bowbridge](https://www.bowbridge.net/en/about-bowbridge-software/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)
- [Customer Login](https://www.bowbridge.net/customer-portal/)

#### Contact

**GERMANY**  
 Tel: +49 (0) 6227 - 69899 - 50  
 Fax: +49 (0) 6227 - 69899-59  
 Email: [info@bowbridge.net](mailto:info@bowbridge.net)

**USA**  
 Tel: +1 650 - 617 - 3408  
 Fax: +1 650 - 617 - 3201  
 Email: [us-sales@bowbridge.net](mailto:us-sales@bowbridge.net)

#### Connect With Us

<https://www.linkedin.com/company/bowbridge-software/> <https://twitter.com/bowbridge_Softw> <https://www.xing.com/companies/bowbridgesoftware>

- [English](https://www.bowbridge.net/en/)
- [Deutsch](https://www.bowbridge.net/)

Copyright © 2023 bowbridge Software GmbH. All rights reserved. [Privacy Policy](https://www.bowbridge.net/en/privacy-policy)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Joerg Schneider-Simon",
    "url" : "https://explore.bowbridge.net/file-security-101/author/joerg-schneider-simon"
  },
  "dateModified" : "2026-11-23T14:50:32.815Z",
  "datePublished" : "2026-11-23T14:50:32.000Z",
  "headline" : "SVG: The Image That Runs Script: Why a Vector Graphic Is Also a Web Page",
  "image" : [ "https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://explore.bowbridge.net/file-security-101/episode-11-svg-the-image-that-runs-script",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://explore.bowbridge.net/hubfs/bowbridge_logo_2-1.png"
    },
    "name" : "bowbridge Software GmbH"
  }
}
```