Microsoft Defender for Office 365 anti-malware policies use the Common Attachment Types Filter to block risky file formats regardless of extension. The evaluation checks whether this filter is enabled across default and custom policies and considers policy precedence that could override or bypass the protection.
Risk
Without consistent attachment type blocking, malicious exe, js, iso, or zip payloads can reach users, enabling code execution and phishing kits.
- Confidentiality: data exfiltration
- Integrity: credential theft/tampering
- Availability: ransomware
Policy scope/priority gaps can leave specific users unprotected.
prowler m365 --checks defender_malware_policy_common_attachments_filter_enabled
Recommendation
Enable the Common Attachment Types Filter in all applicable anti-malware policies and choose a strict action (e.g., Quarantine or Reject).
- Block high-risk formats; review the list regularly
- Align policy precedence to cover every recipient
- Use defense-in-depth: Safe Attachments, Safe Links, ZAP; apply least privilege to file types
Remediation
Set-MalwareFilterPolicy -Identity <POLICY_NAME> -EnableFileFilter $true
- Sign in to Microsoft 365 Defender: https://security.microsoft.com
- Go to Email & collaboration > Policies & rules > Threat policies > Anti-malware
- Open the failing anti-malware policy (e.g., Default or the named custom policy)
- Click Edit protection settings
- Enable "Enable the common attachments filter"
- Click Save
Source Code
Resource Type
NotDefined
References
- https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/common-attachment-blocking-scenarios
- https://learn.microsoft.com/en-us/powershell/module/exchange/set-malwarefilterpolicy?view=exchange-ps
- https://learn.microsoft.com/en-us/defender-office-365/anti-malware-policies-configure?view=o365-worldwide