Dangerous Attachments Delivered by Email
The email filtering service delivers attachments that can run code when opened, such as executables, scripts, disk images or macro-enabled documents.
| Severity | Medium |
| CVSS 3.1 | 5.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N Open in the calculator |
| CVSS 4.0 | 5.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-184: Incomplete List of Disallowed Inputs |
| MITRE ATT&CK | T1566.001 Spearphishing Attachment, T1204.002 Malicious File |
| Category | Security Misconfiguration |
Description
The organisation's email filtering delivers attachments of types that can run code on the recipient's device when opened. Such types include executables and installers (.exe, .scr, .msi), scripts (.js, .vbs, .hta, .ps1, .bat), shortcut and help files (.lnk, .chm), disk images (.iso, .img, .vhd), OneNote files, HTML files used for phishing and HTML smuggling, and Office documents containing macros.
Attackers often place these inside ZIP or other archives, sometimes password-protected so that the filter cannot inspect them, or rename them, to get past filters that check only the outer file or its extension. An attacker can therefore deliver malicious files directly to staff, and a single user opening one may run malware with that user's privileges, giving the attacker remote access to the device and a foothold in the internal network; this is a common first step in ransomware attacks.
The weakness is identified by sending a set of harmless test files of each type, on their own, renamed and inside archives, from an external account to a test mailbox, and recording which are delivered. Because results depend on the gateway's file type rules, malware scanning and sandboxing together, a type that is delivered is reported even if a later control on the endpoint might stop it, as one layer of defence is missing. Whether a delivered file leads to compromise depends on those further controls: endpoint protection, application control, the blocking of macros in files from the internet, and the user recognising the threat. The risk is greater where users have local administrator rights or endpoint controls are weak, and lower where application control would stop the file running.
Remediation
Block attachment types the organisation does not need to receive, and inspect the rest:
- Configure the mail gateway or platform to block or quarantine executable, script, shortcut, disk image and similar file types, identified by their content rather than only their extension. In Microsoft 365 this is the common attachments filter in the anti-malware policy, whose list of file types can be extended; other gateways have equivalent file type rules. Check how the chosen service treats files inside archives, and extend the rules to them where possible.
- Quarantine password-protected archives and other attachments that cannot be scanned, or release them only after review, unless there is a business need to receive them.
- Open permitted attachments in a sandbox before delivery where the service offers it, such as Safe Attachments in Microsoft Defender for Office 365.
- On endpoints, keep macros in Office files from the internet blocked (the default in current Microsoft 365 Apps, which can be enforced with the
Block macros from running in Office files from the Internetpolicy), and use attack surface reduction rules and application control to stop files received by email from running. - Provide a sanctioned way to exchange file types that are blocked, such as an approved file transfer service, so that staff do not look for workarounds.
- Make it easy for staff to report suspicious attachments, and train them to do so.
Confirm the fix by repeating the test with the same set of files and checking that each blocked type is quarantined or rejected, on its own and inside archives.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.