Malware in SVG?

Dec 18, 2022
Cyber Security1 2 Blog
We all know that malware is a serious threat to our online security. But did you know that malware can be hiding in plain sight – in the form of simple images? 
Recently, there has been a spate of reports about malware being found in SVG files. That's right, SVG files can be used to embed malicious code, and unsuspecting users may unknowingly open these files and infect their computers with malware.

In this blog post, we'll explore how this type of attack works, and what you can do to protect yourself against it. So if you're concerned about online security, read on!

What is SVG and why is it such a target for attackers? In this blog post, we'll explore what SVG is, how it's used, and some of the dangers posed by malicious code hidden in these files. Stay tuned for more insights on keeping your organization safe from cyber threats!


  1. What is SVG and how is it used on the web
  2. How can malware be hidden in an SVG file
  3. How to check if an SVG file contains malware
  4. How to protect yourself from malicious SVG files
  5. What to do if you think you’ve been infected by a malicious SVG file

What is SVG and how is it used on the web:

Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics. It stands out among other image formats in web design because of its powerful features and wide compatibility. SVG describes images using shapes, paths, and text, making them independent of resolution or display size, meaning they can be scaled to any size without degradation in image quality. Furthermore, SVG elements can have editable styling attributes such as particular colors, gradients, morphing animations and more -all of which create a super sleek visual experience. In short, this makes SVG the perfect choice for illustrations, icons and logos that need to look sharp regardless of the medium it’s being used on.

How can malware be hidden in an SVG file:

Malware can be hidden in an SVG file by increasing the complexity of the code to make it difficult for even the most experienced engineer to read. For example, malicious embedded Javascript can be used to allow remote access and installation of malicious software. Additionally, infected files can be attached onto a seemingly benign SVG element which has been linked with a popular website or game as bait. Malware creators are constantly evolving their methods of infiltrating systems, which is why it’s important to update antivirus protection regularly and exercise caution when downloading any type of file, even if they appear harmless at first glance.

How to check if an SVG file contains malware:

  1. Scan the file with antivirus software: Most antivirus programs can detect malware in SVG files, so you can use your antivirus software to scan the file for any potential threats.
  2. Inspect the file for suspicious code: You can open the SVG file in a text editor to view the code that makes up the file. Look for any suspicious or unfamiliar code that could potentially be malicious.
  3. Check the file’s metadata: Some malware can be embedded in the metadata of a file, so you may want to check the metadata for any suspicious information. You can use a tool like ExifTool to view the metadata of the file.
  4. Be cautious when downloading SVG files from the internet: If you’re downloading an SVG file from the internet, be sure to download it from a trusted source. Avoid downloading files from suspicious websites or links, as these could potentially contain malware.

It’s important to note that SVG files can be used to deliver malware, but they are not inherently malicious. It’s always a good idea to be cautious when opening any type of file, particularly if it was downloaded from the internet or received from an unknown source.

How to protect yourself from malicious SVG files:

  1. Install antivirus software: Antivirus software can help protect your computer by scanning files for malware and blocking known threats. Make sure to keep your antivirus software up to date to ensure it can detect the latest threats.
  2. Be cautious when downloading files: Only download files from trusted sources and be wary of links or attachments in emails or on social media from unknown sources.
  3. Use a firewall: A firewall can help protect your computer by blocking incoming connections from the internet that may be malicious.
  4. Keep your operating system and other software up to date: Software updates often include security patches to protect against new threats. Make sure to keep your operating system and other software up to date to ensure you have the latest security protections in place.
  5. Enable pop-up blockers: Pop-up windows can sometimes be used to deliver malicious content, so it’s a good idea to enable pop-up blockers in your web browser to help protect against these types of threats.
  6. Use caution when viewing SVG files: If you receive an SVG file from an unknown source, be sure to scan it with antivirus software before opening it. If you’re viewing an SVG file on the internet, be sure to do so from a trusted website.


SVG files can be very dangerous if they contain malware. Be sure to check any file you download for signs of infection and only open SVG files from trusted sources. Protecting yourself from malware in the future is all about being proactive and knowing what to look for. Keep these tips in mind and you’ll be able to enjoy SVG files without worry.

Qbot using SVG to drop malware; here is full read:

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *