AegisAI Perspectives · 210

How email security inspects attachments: PDF, Office, archives, HTML

A file type table showing what sandbox detonation, file type blocking and Mark of the Web catch and miss for each common attachment.

TL;DR
Answer
Email security reads an attachment without running it, opens it in a sandbox, or blocks its file type, and each method misses different files.
Who it's for
IT admins on Microsoft 365 or Google Workspace can check each row against their own tenant.
Watch out for
A sandbox can only judge what it can open and run.
What AegisAI does
AegisAI unpacks archives such as ZIP and RAR, follows links inside PDFs, and chases redirects from those links.
Book a demo

AegisAI opens every link, file and QR code in a sandbox and judges what it finds there.

Or get the Q3 2026 State of the AI Attack report (free, instant download)

How email security inspects attachments: PDF, Office, archives, HTML

Email security reads an attachment without running it, opens it in a sandbox, or blocks its file type, and each method misses different files.9,13 AegisAI opens every link, file and QR code in a sandbox and judges what it finds there.18

How does email security detect malicious attachments such as PDFs, Office files and archives?

Four controls do the work, and each one stops at a different file. MITRE ATT&CK, a public catalogue of attacker techniques, tracks a malicious email file as Spearphishing Attachment (T1566.001) and its opening as Malicious File (T1204.002).9,12 The FBI and CISA, the US Cybersecurity and Infrastructure Security Agency, wrote in May 2025 that threat actors "frequently use spearphishing hyperlinks and attachments" to deliver LummaC2, malware that steals data.16 How AegisAI follows a file or link to its end is on the email phishing prevention page.

  1. Static checks read the file's structure, text and metadata without running it. A 2026 preprint (not peer reviewed) describes this as an "execution-free static feature pipeline" for Word, Excel, PDF and HTML files.15

  2. Sandbox detonation opens the file in a sandbox, an isolated virtual environment, and watches what it does. The US standards body NIST calls these environments "detonation chambers".13

  3. File type blocking rejects or quarantines, on arrival, the file types an admin lists. MITRE advises blocking "unknown or unused attachments by default".9

  4. Mark of the Web is a tag Windows adds to files from the internet, including email attachments. Office on Windows then blocks macros, small programs stored inside the file, in those files by default.4

NIST also lists "sanitization of attachments" among controls applied before delivery and does not define it further.13

Email attachment threat detection

Each file type meets a different control. Microsoft cells describe its common attachments filter and Safe Attachments, its attachment sandbox. Google cells describe Security Sandbox, Gmail's attachment sandbox, and the Gmail attachment safety settings. IT admins on Microsoft 365 or Google Workspace can check each row against their own tenant.

File type and techniqueWhat the documented controls catchWhat falls outside themSources
PDF with a link or QR code image insideDetonation in Safe Attachments and in Google Security Sandbox, which lists PDF. Microsoft lists pdf as an optional filter type, not a default.A QR code image moves the user to a phone. The FBI calls this quishing and says it evades "URL inspection, rewriting, and sandboxing".1, 2, 7, 12, 17
Office with macros (doc, docm, xls)Microsoft blocks docm by default; doc and xls are optional. Google offers a setting for attachments with scripts. Office on Windows blocks macros in files that carry Mark of the Web.A user who selects Unblock in file Properties removes the mark. Files saved to a Trusted Location open with macros enabled. Office on Mac and on the web is outside the change.2, 4, 8
ZIP or RAR archive (one file that packs others)Google Security Sandbox rules scan "files inside archive attachments, for example zip or rar files". Microsoft lists zip, rar and 7z as optional filter types.MITRE says the files inside container files, such as archives and disk images, "may not inherit the MOTW" (Mark of the Web) once they are extracted.2, 7, 11
Encrypted (password-protected) archiveMicrosoft can quarantine messages with encrypted attachments it could not scan. Google can warn, move to spam or quarantine encrypted attachments from untrusted senders.Safe Attachments "can't fully scan or detonate" the file unless the password is available, for example in the email body. Google states encrypted attachments "can't be scanned for malware".1, 8
ISO or IMG disk imageBoth types are on Microsoft's default blocked list. MITRE suggests blocking container file types and turning off auto-mounting.MITRE records the QakBot malware packaged in ISO files "to bypass Mark of the Web".2, 11
Windows shortcut (LNK) filelnk is on Microsoft's default blocked list. MITRE lists .lnk among files users are lured to open.Microsoft's page does not state whether the filter matches a shortcut inside an archive.2, 12
HTML or SVG file (HTML smuggling, SVG smuggling)Microsoft lists htm and html as optional filter types. Google can flag attachment types that are uncommon for your domain.The file builds its payload in the browser when opened. SVG appears in neither Microsoft list.2, 8, 10, 22, 23
OneNote file with embedded filesMicrosoft lists one and onenote as optional filter types. OneNote for Microsoft 365 on Windows blocks embedded files with dangerous extensions.The block does not cover OneNote on Mac, Android, iOS, the web or OneNote for Windows 10. Extensions an admin adds to the allow list are no longer blocked.2, 5

Why a sandbox misses some attachments

A sandbox can only judge what it can open and run.

  • An encrypted archive stays closed without its password. Microsoft's encrypted attachment setting also does not handle one archive whose items have different passwords.1
  • HTML smuggling builds the payload later. It hides "malicious payloads inside of seemingly benign HTML files", and the file writes the payload once it runs in the browser.10 MITRE tracks the SVG form as SVG Smuggling (T1027.017).23 AegisAI Threat Watch covered one such campaign, reported by outside researchers, in which a fake court notice arrives as an SVG image file and assembles a password-protected ZIP in the browser (Blind Eagle case).22
  • A file can go to the wrong scanner. A file-type router decides which scanner reads each attachment. In an October 2025 preprint (not peer reviewed), Nasr and colleagues changed 13 bytes of malware samples and evaded the router Gmail uses in 90% of cases.14 Their Gmail test also required altering or removing the file extension. The authors state their defense is already deployed in production for the Gmail classifier.14
  • A file can look clean at scan time. Microsoft lists "Content weaponized after delivery to users" among the cases for zero-hour auto purge (ZAP), which quarantines mail after delivery.3

What Microsoft 365 and Google Workspace document

Microsoft states anti-malware protection is on by default for every organization with cloud mailboxes.2 Its common attachments filter rejects listed file types by default and matches the true file type where it can, falling back to the extension.2 Safe Attachments, in Defender for Office 365, checks attachments in a virtual environment before they are delivered, and a scan typically completes within 15 minutes.1

Google states it scans all messages for malware whether or not attachment settings are on.8 Security Sandbox is off by default6, runs on listed editions, and can delay delivery by up to 3 minutes.7 The two figures measure different things. The edition list and what the sandbox leaves out are in what Gmail Security Sandbox misses.

Checks to run on your own tenant

  1. Open your anti-malware policies in the Microsoft Defender portal and compare the common attachments filter list with the table.2
  2. Go to Apps > Google Workspace > Gmail > Spam, Phishing and Malware in the Google Admin console and confirm that Security Sandbox has "Enable virtual execution" checked.6
  3. Go to Apps > Google Workspace > Gmail > Safety in the Google Admin console and set the action for encrypted attachments from untrusted senders.8
  4. Confirm in Group Policy or the Cloud Policy service for Microsoft 365 Apps for enterprise that "Block macros from running in Office files from the Internet" is on for each Office app.4

What AegisAI does with attachments

AegisAI opens every link, file and QR code in a sandbox, follows it to the end, and judges what it finds there.18 AegisAI pulls apart attachments of all kinds in secure, sandboxed environments.20 AegisAI unpacks archives such as ZIP and RAR, follows links inside PDFs, and chases redirects from those links.20 AegisAI checks reputation, intent, policy and headers in parallel.19

AegisAI decodes a QR code to a URL and detonates it like any other link.18 AegisAI treats a CAPTCHA gate, a test that keeps automated visitors out, as evidence and never scores a hidden page clean.18 AegisAI gives newsletters the same investigation as any email, links and files included.21

More detail is in link and attachment analysis and evasive links and attachments. QR codes have their own page, QR code phishing. To see it on your own mail, book a demo.

Questions people ask

How does AegisAI inspect email attachments?

AegisAI opens every file in a sandbox and follows it to the end. AegisAI unpacks archives such as ZIP and RAR, follows links inside PDFs, and chases redirects from those links.

How does email security detect malicious attachments such as PDFs, Office files and archives?

It uses four controls together. Static checks read the file, sandbox detonation runs it, file type blocking stops risky types on arrival, and Mark of the Web makes Office block macros in files from the internet.

What is email attachment threat detection?

Email attachment threat detection is the set of checks that decide whether a file sent by email is malicious. It covers reading the file, running it in a sandbox, and blocking file types an organization never needs.

How do email security solutions identify malicious attachments and links?

Attachments are read, detonated or blocked by type. Links are opened in a sandboxed browser-like component that records the results, which NIST describes as an automated step.

How do zero-day email attacks evade traditional security filters?

Microsoft names zero-day malware that was undetectable during mail flow as a case for quarantine after delivery. Attackers also hide the payload behind a password, or build it in the browser after the scan.

Can email security scan password-protected attachments?

Often not in full. Microsoft says Safe Attachments needs the password, for example from the email body. Google states encrypted attachments cannot be scanned for malware and offers a warning, spam or quarantine action.

Sources

  1. Microsoft Learn: Safe Attachments, updated 10 August 2026, read 3 December 2026
  2. Microsoft Learn: Anti-malware protection for email in Microsoft 365, updated 12 June 2026, read 3 December 2026
  3. Microsoft Learn: Zero-hour auto purge in Microsoft Defender for Office 365, updated 7 August 2026, read 3 December 2026
  4. Microsoft Learn: Macros from the internet are blocked by default in Office, updated 31 July 2026, read 3 December 2026
  5. Microsoft Learn: OneNote blocks embedded files that have dangerous extensions, updated 9 December 2025, read 3 December 2026
  6. Google Workspace Admin Help: Gmail Security Sandbox overview, updated 3 December 2026, read 3 December 2026
  7. Google Workspace Admin Help: Set up rules to detect harmful attachments, date not shown, read 3 December 2026
  8. Google Workspace Admin Help: Advanced phishing and malware protection, updated 3 December 2026, read 3 December 2026
  9. MITRE ATT&CK: Phishing: Spearphishing Attachment, T1566.001, modified 11 September 2026, read 3 December 2026
  10. MITRE ATT&CK: Obfuscated Files or Information: HTML Smuggling, T1027.006, modified 12 May 2026, read 3 December 2026
  11. MITRE ATT&CK: Subvert Trust Controls: Mark-of-the-Web Bypass, T1553.005, modified 3 November 2026, read 3 December 2026
  12. MITRE ATT&CK: User Execution: Malicious File, T1204.002, modified 12 May 2026, read 3 December 2026
  13. NIST SP 800-177 Rev. 1, Trustworthy Email, February 2019, standard, read 3 December 2026
  14. Nasr et al.: Evaluating the Robustness of a Production Malware Detection System to Transferable Adversarial Attacks, preprint, not peer reviewed, 2 October 2025, read 3 December 2026
  15. Nejati et al.: CIC-Trap4Phish, a multi-format dataset for phishing and quishing attachment detection, preprint, not peer reviewed, February 2026, read 3 December 2026
  16. FBI and CISA: Threat Actors Deploy LummaC2 Malware, advisory AA25-141B, 21 May 2025, read 3 December 2026
  17. FBI FLASH AC-000001-MW: Kimsuky QR code spearphishing against U.S. entities, 8 January 2026, read 3 December 2026
  18. AegisAI: Email phishing prevention, read 3 December 2026
  19. AegisAI: Platform, read 3 December 2026
  20. AegisAI: What happens when the attacker hides the payload?, 20 October 2026, read 3 December 2026
  21. AegisAI: Graymail and spam control, read 3 December 2026
  22. AegisAI Threat Watch: Blind Eagle, a fake court notice that builds its own ZIP in the browser, 10 November 2026, read 3 December 2026
  23. MITRE ATT&CK: Obfuscated Files or Information: SVG Smuggling, T1027.017, modified 12 May 2026, read 3 December 2026

Recent posts

Every email, investigated.