IT consultant with a laptop beside a colleague working at a server rack

LIBRARY 3.28Microsoft 365 Security Library

How to Block Dangerous Attachment Types in Microsoft 365

Programs, scripts and disk images have no business arriving by email. The common attachments filter blocks them by file type before anyone can open one. Here is how to check it’s on and what to add.

Reviewed by Ali Hassani, C|CISO, CISSP · Last verified November 20, 2026

25+ yearsIT and cybersecurity experience
Certified CISOC|CISO · CISSP · Microsoft · Cisco
Southern CaliforniaBased in Irvine, on-site by appointment
NationwideRemote Microsoft 365 audits

Intelligence Center › Microsoft 365 Security Library › Email threats

Email security check
Time to fixAbout 10 minutes
Staff impactLow: staff can’t receive programs or scripts by email; share them another way
LicensingAll Microsoft 365 plans with Exchange Online
Last verifiedNovember 20, 2026, against Microsoft Learn
Works onBusiness BasicBusiness StandardBusiness PremiumE3E5

The common attachments filter is part of anti-malware policies in Exchange Online Protection, included with every plan that has Exchange Online (Microsoft Learn).

In one minute

  1. Open the default anti-malware policy.
  2. Turn on Enable the common attachments filter.
  3. Keep Microsoft’s default file types and consider adding scripts such as .js and .ps1.
  4. Leave the action as Reject the message.

Attachment filtering is part of the email security checks in our Microsoft 365 Security Audit.

What it is

What the common attachments filter does

Microsoft describes the filter simply: some file types, such as executables, aren’t suited to email, so rather than scanning them for malware, block them all. When the filter finds a listed type, the message is rejected with a non-delivery report (the default) or quarantined (Microsoft Learn).

The filter uses true type matching where it can, reading the file itself rather than trusting the name, so an .exe renamed to .txt is still detected as an .exe (Microsoft Learn).

What Microsoft’s default list covers

GroupExamples from the default listWhy block them
Programs and installers.exe, .msi, .msix, .com, .scr, .dllRun code directly
Scripts.bat, .cmd, .vbs, .vbe, .wsf, .hta, .jarRun code through Windows
Disk images and archives.iso, .img, .cab, .arj, .xzUsed to smuggle programs past filters
Shortcuts and settings.lnk, .reg, .scf, .pifLaunch or change things silently
Macro add-ins.docm, .ppam, .xllOffice files built to run code

Why it matters

Most infections still start with a file someone opened

  1. Email with an attachmentInvoice, voicemail, shipping notice.
  2. New malware, not yet knownScanner finds nothing.
  3. File type blockedRejected before delivery.
  4. User opens itWithout it: code runs on the PC.
  5. Ransomware or account theftSpreads from there.

Drawing: where the attachment filter breaks the path.

$10.22M

average cost of a U.S. data breach in 2025, according to IBM.

Source: IBM
53

file types on Microsoft’s default block list.

Source: Microsoft Learn
Dec 2023

since when the filter is on by default in new tenants; older tenants may still have it off.

Source: Microsoft Learn
10

minutes is a realistic time to switch it on.

Source: Our estimate

How the protections fit together

ProtectionWhat it doesEffect
Common attachments filterBlocks by file type, even unknown malware.Stops the obvious
Malware scanningCatches known malware in any attachment.Always on
Safe Attachments (Defender for Office 365)Opens files in a sandbox before delivery.Catches new threats
Filter off, no Safe AttachmentsOnly known malware is stopped.Gap

Microsoft notes the filter is on by default in new policies and in the default policy of organizations created after December 1, 2023 (Microsoft Learn). Older tenants should check.

What we find in audits

What this finding looks like in our audit reports

These are real pages from our published compromise assessment sample, written for a fictional company. Click any page to open it full size.

Compromise Assessment · Technical ReportSAMPLE · Contoso Ltd is a fictional company1 / 4
Compromise Assessment · Technical Report, Page 41 · Finding F-62: The finding, ready to act on.
The finding, ready to act on. In our compromise assessment sample, the default anti-malware policy did not block risky attachment types such as .exe, .js and .iso.

Your options

What each plan gives you

CapabilityAll plans with Exchange OnlineDefender for Office 365 (Business Premium, E5 or add-on)
Common attachments filterYesYes
Add your own file typesYesYes
Malware scanning and zero-hour auto purgeYesYes
Safe Attachments sandboxNoYes

If users are covered by the Standard or Strict preset security policies, those presets already turn the filter on and settings in other anti-malware policies are ignored for them (Microsoft Learn).

How to check it yourself

See whether the filter is on, without changing anything

Open the default policy and look at Protection settings. Enable the common attachments filter should be on.

Read-only PowerShell: common attachments filter status

Connect-ExchangeOnline
Get-MalwareFilterPolicy |
  Select-Object Name, EnableFileFilter, FileTypeAction, @{n="Types";e={$_.FileTypes.Count}}

The command only reads settings. EnableFileFilter False means risky file types are delivered unless malware scanning recognizes them.

How to configure

How to turn on the common attachments filter, step by step

All plans

Turn it on

  1. Open Threat policies › Anti-malware and select the default policy.
  2. Select Edit protection settings.
  3. Turn on Enable the common attachments filter.
  4. Keep Reject the message with a non-delivery report (NDR) as the action.
  5. Select Save, then repeat for any custom anti-malware policies.

Go further

Tighten the list

  1. Under Select file types, consider adding script types such as .js, .ps1 and .wsh.
  2. Microsoft also suggests blocking extensions like .cpl, .inf and .url with a mail flow rule.
  3. Turn on Safe Attachments if you have Defender for Office 365.
  4. Tell staff how to share programs safely, for example through OneDrive.

What your users will notice

Senders get a bounce if they email a blocked file type. Normal Office files and PDFs aren’t affected.

How to undo it

Turn off Enable the common attachments filter in the policy, or remove one file type from the list.

Proof and questions

How to prove it is fixed, and what to ask your IT provider

Evidence it is fixed

  • EnableFileFilter is True on every anti-malware policy.
  • The action is Reject, or Quarantine with admin-only release.
  • A test message with a harmless renamed file type is blocked.
  • Safe Attachments is on where licensed.

Questions for your IT provider

  • Is the common attachments filter on in every anti-malware policy?
  • Which file types are on our list, and have any been removed?
  • Do we use Safe Attachments, and for which users?
  • How do staff share programs or scripts when they need to?
  • Who gets notified when malware is blocked?

Signs it was already abused

If a dangerous attachment may already have been opened, look for these signs

Red flags

  • Mail with .iso, .img, .lnk or .js attachments in user mailboxes.
  • Defender or antivirus alerts shortly after an email was opened.
  • A PC suddenly slow, or new programs nobody installed.
  • Sign-ins from new places soon after an attachment was opened.
  • Users reporting a file that “didn’t open”.

If you see these, isolate the PC and keep the evidence. Our compromise investigation establishes what ran and what was reached, and the Microsoft 365 Evidence Clock shows how long the records are kept.

Framework mapping

Where attachment filtering fits

FrameworkWhere it fits
NIST CSF 2.0PR.PS-01: configuration management; DE.CM-09: monitoring of software and data
ISO/IEC 27001:2022Annex A 8.7 Protection against malware
SOC 2CC6.8 prevention of unauthorized or malicious software

Reviewed by

Written and reviewed by a practicing CISO

Ali Hassani, CISO and founder of OC Security Audit

Ali Hassani, C|CISO, CISSP

Ali has more than 25 years of IT and cybersecurity experience and holds the Certified CISO and CISSP certifications along with Microsoft and Cisco credentials. He leads every OC Security Audit engagement from Irvine, on-site across Southern California and remotely nationwide. Every Microsoft 365 audit is read-only.

FAQ

Frequently asked questions about blocking attachment types

What is the common attachments filter?

A setting in Microsoft 365 anti-malware policies that blocks email attachments by file type, such as .exe, .iso or .vbs, whether or not they contain known malware.

Is it on by default?

In new anti-malware policies and in the default policy of organizations created after December 1, 2023, yes. Older tenants should check.

Will it block Word, Excel or PDF files?

No. The default list targets programs, scripts, disk images and macro add-ins such as .docm, not normal documents.

Should we reject or quarantine?

Microsoft's recommended setting is Reject. Quarantine is an option if you want admins to review blocked files.

Is this the same as Safe Attachments?

No. Safe Attachments opens files in a sandbox and needs Defender for Office 365. The attachment filter blocks by type and works on every plan.

Which plans include it?

All Microsoft 365 plans with Exchange Online.

Next step

Stop the files that should never arrive

Prevent

Microsoft 365 Security Audit

$3,500 fixed

About 200 read-only checks across sign-in protection, email, sharing and devices, for any tenant size, with four reports and a remediation roadmap.

Respond

Microsoft 365 & Azure Compromise Investigation

From $3,500

For when an attachment was opened and something ran: we establish what happened and what was reached.

Want to see the deliverables first? Open the Microsoft 365 audit sample report or browse all our sample reports.

Related reading: How to turn on Safe Links and Safe Attachments · How to control quarantine release · How to remove allowed sender domains

Sources

Sources used on this page

  1. Microsoft Learn, Anti-malware protection for cloud mailboxes
  2. Microsoft Learn, Configure anti-malware policies
  3. Microsoft Learn, Recommended email and collaboration threat policy settings
  4. Microsoft Learn, Frequently asked questions: anti-malware protection
  5. IBM newsroom, Cost of a Data Breach Report 2025

This guide is general information, not a guarantee of protection or legal advice. Microsoft changes its admin centers often: menu names and steps were checked against Microsoft Learn on November 20, 2026. Drawings are simplified and are not screenshots of Microsoft products. Sample findings come from fictional companies. Incidents are described as reported by the cited sources; OC Security Audit was not involved in them. Questions? Call 949-777-5567 or email support@ocsecurityaudit.com.