Learn More about Benny Czarny's Book Cybersecurity Upside Down

Learn More
We utilize artificial intelligence for site translations, and while we strive for accuracy, they may not always be 100% precise. Your understanding is appreciated.

How Do Polyglot Attachments Bypass Email Security?

One attachment, multiple valid formats. See how pre-delivery structural detection catches polyglots.
By OPSWAT

Key Takeaways

  • A polyglot attachment can present multiple valid formats, making structural identification essential to correct inspection routing
  • Real campaigns show that polyglot attachments can support phishing delivery by concealing multiple file formats within one attachment
  • MetaDefender™ Email Gateway Security can use File Structure Validation in its MetaDefender Core™-based workflow to detect supported stacked-file polyglots before delivery when licensed, enabled, and configured

How Polyglot Attachments Evade Single-Type Email Scanning

The risk is visible in real campaigns. In late June 2025, BI.ZONE Mail Security detected a wave of phishing emails targeting Russian healthcare and IT organizations from compromised addresses belonging to legitimate organizations. BI.ZONE attributed the campaign to Rainbow Hyena and found that the ZIP attachments were also PE32+ DLLs, concealing a decoy and a ZIP archive with a shortcut file. The attackers used the polyglot structure to improve their chances of bypassing email filters.

That structure creates a routing problem. Consider a GIF that is also a valid Java archive: a photo viewer reads an image, while the Java runtime reads an executable archive. When a pipeline assigns only one type, downstream engines may analyze one face without routing the other to the appropriate processor. One File, Many Faces: Why Polyglot Detection Matters explains the file-level mechanics in detail.

Real-world research reinforces the value of format-aware inspection. In July 2023, JPCERT/CC analyzed an in-the-wild file that combined valid PDF structure with a Word-compatible MHT document containing a macro. PDF-focused and Word-focused analysis produced different findings, illustrating why security workflows benefit from examining every valid interpretation of a file.

The container is one component of the attack chain. Each subsequent stage creates another opportunity for prevention, inspection, or behavioral detection. BI.ZONE documented that path in the Rainbow Hyena campaign:

  1. The recipient opens the attachment and launches the shortcut file inside its ZIP archive
  2. The shortcut runs PowerShell with a hidden window
  3. PowerShell searches the current directory, the user profile, and the temp directory for the polyglot file
  4. The script runs the polyglot through rundll32.exe, which executes the PhantomRemote backdoor inside the DLL
  5. A decoy document, a PDF or an XLS depending on the sample, is extracted from the polyglot and opened

Each step adds engineering effort and another control point. Gateway inspection can validate the attachment structure, endpoint controls can monitor shortcut and interpreter behavior, and policy can govern higher-risk file types or execution paths. Polyglot detection strengthens the earliest decision by exposing the file’s full structure before the recipient starts the chain.

Why Polyglots Remain Uncommon Today

An Oak Ridge National Laboratory-led study published at The Web Conference 2025 found that the tested file-format and embedded-file detection tools did not reliably detect in-the-wild polyglots. The finding gives defenders a practical basis for evaluating structural inspection, while public reporting suggests the technique remains selective.

That selectivity reflects the engineering required to build a dependable chain. Operators must align compatible formats, test how different parsers interpret the file, and connect the container to an execution path that remains reliable on the target system. For a high-value target, however, that investment can be worthwhile.

Well-Funded Attackers Can Afford the Price

In late October 2024, Proofpoint documented a campaign aimed at fewer than five customers in the United Arab Emirates, with an interest in aviation, satellite communications, and critical transportation infrastructure. Tailored messages came from a compromised account at an Indian electronics company with a trusted business relationship with the targets.

The linked ZIP archive contained a shortcut disguised as a spreadsheet and two stacked-file polyglot PDFs. One combined PDF and HTA content; the other appended a ZIP archive to a PDF. The shortcut then initiated hidden stages that decoded and launched the Sosano backdoor.

For defenders, the operational lesson is to evaluate the complete interpretation and execution path rather than relying on the visible extension or first recognized format. The shortcut, appended content, interpreter behavior, and resulting process chain each provide distinct inspection and detection opportunities.

The campaign analysis characterized polyglot use as unusual in espionage telemetry and consistent with an operator prioritizing concealment. For security leaders, the conclusion is clear: a low-frequency technique still matters when it protects a high-value attack chain or targets critical operations.

Why Polyglot Detection Matters for Email Security

Email gives a campaign broad reach through a familiar business workflow. That makes pre-delivery attachment inspection a valuable layer within a defense-in-depth program.

Compromised trusted accounts make content inspection especially important. Both the Rainbow Hyena and UAE campaigns used accounts belonging to legitimate organizations. Authentication confirms the message path and sender authorization; content inspection evaluates the attachment itself. Strong email security combines those controls with message, URL, and behavioral analysis.

Polyglots belong to a broader attachment-inspection discipline. Security teams also account for concealed content, nested containers, active document features, encryption, and misleading file types. Each technique benefits from a purpose-built control:

  • Concatenated files: one format appended to another, such as a ZIP attached to a PDF, which is also a common way to build a polyglot
  • Steganography: a payload hidden inside the content of an ordinary file, such as an image
  • File type spoofing: a file disguised through a misleading extension, header, or type label
  • Nested archives: content wrapped in multiple container layers, such as a ZIP that contains another archive or an embedded executable
  • Embedded objects and active content: macros, scripts, or other executable content tucked inside a document
  • Password-protected archives: encrypted containers that become inspectable after the workflow obtains the password

A rigorous gateway evaluation maps each risk to a control. Security teams should verify how the workflow validates declared file types, recurses through containers, inspects active or embedded content, processes encrypted attachments when credentials are available, sanitizes supported formats, and records policy decisions. File support, configuration, licensing, and deployment architecture determine effective coverage.

How MetaDefender Email Gateway Security Detects Polyglot Attachments

MetaDefender Email Gateway Security is OPSWAT’s solution for protecting organizations from phishing, ransomware, and Zero-Day threats before they reach user inboxes. Deployed at the SMTP/MX level, it applies multiscanning, Deep CDR™ Technology, AI-powered malware analysis, adaptive sandbox, phishing detection, and DLP to inspect, sanitize, and control email content across inbound and outbound workflows.

The platform supports encrypted and password-protected attachment inspection, centralized policy enforcement, and compliance reporting while operating in on-premises, disconnected, and air-gapped environments. By applying layered prevention before delivery, MetaDefender Email Gateway Security helps reduce email-borne risk, support regulatory requirements, and protect both IT and OT environments.

Within that layered workflow, four controls are particularly relevant to polyglot attachments:

  • File Type Detection: identifies the attachment’s actual format and establishes the correct inspection path.
  • File Structure Validation: detects supported stacked-file polyglots, returns confirmed faces as separate objects, and preserves the original file during inspection. Review current polyglot support or explore File Structure Validation.
  • Metascan™ Multiscanning: applies multiple anti-malware engines and evaluates their results against workflow thresholds.
  • Deep CDR™ Technology: reconstructs supported files according to policy and removes or sanitizes potentially harmful active content.

Policy then determines whether to deliver the message or sanitized content, remove an attachment, block the message, or hold it for review. Email history, audit logs, and SIEM integration support investigation and policy tuning.

Build Polyglot Detection into Pre-Delivery Email Security

Polyglot attachments challenge the assumption that one file has one format. When File Structure Validation is licensed, enabled, and configured in the MetaDefender Core-based workflow, it can detect supported stacked-file polyglots, separate confirmed faces, and return each face for processing by the appropriate configured layers before delivery.

Explore MetaDefender Email Gateway Security to assess how pre-delivery structural validation fits your environment.

Stay Up-to-Date With OPSWAT!

Sign up today to receive the latest company updates, stories, event info, and more.