T1027.017

SVG Smuggling

Adversaries may smuggle data and files past content filters by hiding malicious payloads inside of seemingly benign SVG files. SVGs are vector-based image files constructed using XML and can legitimately include <script> tags, enabling adversaries to embed malicious JavaScript payloads. SVGs may appear less suspicious to users than other executable file types since they are often treated as image files. SVG smuggling can assemble or download malicious payloads, redirect users to malicious websites, or display interactive content such as fake login forms. SVG Smuggling may be used in conjunction with HTML Smuggling where an SVG with a malicious payload is included inside an HTML file.

Microsoft Sentinel / Defender
kusto
// Detect SVG files opened by browsers or mail clients that subsequently spawn processes or download files
let SuspiciousChildProcesses = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "msiexec.exe", "bitsadmin.exe", "curl.exe", "wget.exe"]);
let BrowserProcesses = dynamic(["chrome.exe", "msedge.exe", "firefox.exe", "iexplore.exe", "opera.exe", "brave.exe"]);
let MailClients = dynamic(["outlook.exe", "thunderbird.exe", "winmail.exe"]);
// Detection 1: Browser or mail client spawning suspicious child processes after SVG-related activity
let SvgSpawnedProcesses = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName has_any (BrowserProcesses) or InitiatingProcessFileName has_any (MailClients)
| where FileName has_any (SuspiciousChildProcesses)
| extend SvgContext = InitiatingProcessCommandLine has ".svg"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, SvgContext,
          DetectionType = "SuspiciousChildProcess";
// Detection 2: SVG files written to disk by browsers or mail clients
let SvgFileWrites = DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName endswith ".svg"
| where InitiatingProcessFileName has_any (BrowserProcesses) or InitiatingProcessFileName has_any (MailClients)
| project Timestamp, DeviceName, AccountName = InitiatingProcessAccountName,
          FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine,
          SvgContext = true, DetectionType = "SvgFileWrite";
// Detection 3: Script execution from temp/download directories (common SVG payload drop locations)
let SvgPayloadExecution = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (SuspiciousChildProcesses)
| where FolderPath has_any ("\\Downloads\\", "\\Temp\\", "\\AppData\\Local\\Temp\\", "\\AppData\\Roaming\\")
| where InitiatingProcessFileName has_any (BrowserProcesses) or InitiatingProcessFileName has_any (MailClients)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, FolderPath,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          SvgContext = false, DetectionType = "PayloadFromDownloads";
union SvgSpawnedProcesses, SvgFileWrites, SvgPayloadExecution
| sort by Timestamp desc
high severity medium confidence

Data Sources

File: File Creation Process: Process Creation Network: Network Connection Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceFileEvents

False Positives

  • Legitimate SVG downloads from design or documentation tools where developers open SVG files normally
  • Web development workflows where SVG files are edited and executed locally via browser for testing
  • Corporate applications that use SVG icons or graphics and invoke browser rendering legitimately
  • Email clients that preview SVG images attached to legitimate business communications

Unlock Pro Content

Get the full detection package for T1027.017 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections