How Threat Actors Embed Malicious JavaScript in Vector Files

How Threat Actors Embed Malicious JavaScript in Vector Files

Cybersecurity researchers have identified an emerging attack campaign where threat actors are weaponizing Scalable Vector Graphics (SVG) files to deliver sophisticated JavaScript-based redirect attacks.

This technique exploits the inherent trust placed in image formats, allowing malicious actors to embed obfuscated JavaScript within seemingly harmless vector graphics files that execute automatically when opened in web browsers.

Cybercriminals Exploit Trusted Image Format

The attack methodology centers on embedding malicious JavaScript code within SVG files using CDATA sections, which are typically used for legitimate purposes in XML-based formats.

The embedded scripts utilize static XOR encryption keys to decrypt secondary payloads at runtime, subsequently reconstructing and executing redirect commands through the Function() constructor.

The Recipient’s perspective

The final malicious URLs are assembled using the atob() function and include Base64-encoded strings that serve dual purposes as victim tracking tokens and correlation identifiers for the attackers’ infrastructure.

What makes this campaign particularly insidious is its ability to bypass traditional security controls.

Unlike conventional malware delivery methods that rely on executable files or macros, this technique leverages browser-native functionality to achieve code execution without dropping files or requiring user interaction beyond opening the SVG.

The payload construction is deliberately evasive, with the final redirect destination assembled dynamically to avoid static detection mechanisms.

Sophisticated Delivery

The threat actors behind this campaign employ a multi-layered delivery strategy that begins with carefully crafted phishing emails using spoofed or impersonated sender identities.

According to Ontinue Report, these emails exploit organizations with weak email authentication configurations, specifically targeting entities lacking DKIM records and those with DMARC policies set to monitoring rather than quarantine or reject modes.

The attackers leverage lookalike domains that closely resemble legitimate entities, enhancing the credibility of their communications.

The campaign demonstrates tactical sophistication in its targeting approach, primarily focusing on Business-to-Business service providers, financial institutions, utilities, and Software-as-a-Service companies.

These sectors are strategically chosen because they regularly handle valuable corporate and employee data while expecting high volumes of external communications, making malicious emails less likely to raise immediate suspicion.

The emails themselves are engineered for minimal content to reduce detection probability while incorporating subtle social engineering themes around missed calls, payment notifications, and task management applications.

Recent developments in the campaign include the implementation of geofencing capabilities on landing sites, suggesting an evolution toward more targeted and region-specific attacks.

The attacker infrastructure employs randomized domain structures and subdomain-based hosting that complicates static filtering efforts.

Domain reputation analysis reveals consistently low or unknown ratings, with hosting patterns suggesting regular rotation of campaign infrastructure to maintain operational security.

This attack represents a significant evolution in threat landscape dynamics, bridging traditional phishing methodologies with advanced evasion techniques.

By exploiting the trusted nature of image formats and leveraging legitimate browser functionality, attackers can achieve their objectives while avoiding behavioral and signature-based detection systems.

The campaign’s success demonstrates the critical need for enhanced email authentication controls and the importance of treating all file attachments, regardless of format, as potential security risks requiring thorough analysis before execution.

Get Free Ultimate SOC Requirements Checklist Before you build, buy, or switch your SOC for 2025 - Download Now


Source link