How to Handle Email Attachments Safely: Which Files Are Risky

By Information Security Asia · Updated November 21, 2026 · 4 min read

Short answer: treat any unexpected attachment as suspicious, even from someone you know, and confirm with the sender through another channel before opening it. Be most careful with executables, scripts, disk images, archives, HTML files and Office documents that ask you to “enable content” or “enable macros”. Preview documents in your email service’s viewer when possible, keep Office’s Protected View on, and never enter your password on a page that an attachment opens.

Malicious attachments remain one of the most common ways malware reaches computers, especially in business email. Attackers constantly change file types to get past email filters, so knowing the patterns matters more than memorising a list.

How to Handle Email Attachments Safely: Which Files Are Risky

Attachment risk by file type

Risk File types Why
Very high .exe, .scr, .msi, .bat, .cmd, .js, .vbs, .ps1, .hta, .lnk Run code directly when opened
High .iso, .img, .vhd, .zip, .rar, .7z (especially password-protected) Used to hide executables and evade scanning
High .html, .htm, .svg Open local phishing pages that steal passwords
Medium to high .docm, .xlsm, older .doc/.xls with macros, .one (OneNote) Can run macros or embedded content if you enable them
Medium .pdf Usually safe in updated viewers, but often contain phishing links
Lower .jpg, .png, .txt, .docx without macros Rarely dangerous on updated software, but check names

Watch for double extensions such as invoice.pdf.exe. Windows hides known file extensions by default; turning on File name extensions in File Explorer’s View menu makes these tricks visible.

How malicious attachments infect computers

  • Macro documents: a Word or Excel file displays a blurred message telling you to click “Enable Content”. Doing so runs code. Microsoft now blocks macros by default in Office files downloaded from the internet, which has pushed attackers to other formats.
  • Archives and disk images: a ZIP or ISO contains a shortcut or script disguised as a document.
  • HTML attachments: open a convincing login page in your browser to harvest your password, without any malware.
  • PDFs with links: “Click to view secure document” leads to phishing.
  • Exploits: rarely, a file exploits an unpatched vulnerability in a viewer.

Before opening any attachment

  1. Were you expecting it? Unexpected invoices, shipping documents, voicemails, payroll files and “shared documents” are classic lures.
  2. Check the real sender address, not just the display name.
  3. Verify with the sender by phone or a separate message if anything feels off. Compromised accounts send malicious attachments to their contacts.
  4. Look at the file type against the table above.
  5. Use the preview. Gmail and Outlook on the web render many files in the browser without running macros.
  6. Scan suspicious files with your antivirus or check their hash; see how to use VirusTotal correctly.

Safe settings to keep on

  • Office Protected View: files from the internet open read-only. Do not click “Enable Editing” unless you trust the file.
  • Macros blocked for files from the internet (the default in current Microsoft 365).
  • Show file extensions in Windows.
  • Microsoft Defender SmartScreen and your antivirus on and updated.
  • Keep Office, PDF readers and browsers updated.

If you opened a malicious attachment

  1. Disconnect from the network (Wi-Fi off or cable unplugged).
  2. At work, tell IT immediately. Fast reporting can stop ransomware spreading.
  3. At home, run a full antivirus scan, ideally an offline scan. See removing malware from a Windows PC.
  4. If you entered a password on a page the attachment opened, change it from a clean device and turn on two-factor authentication.
  5. Watch your accounts for unusual activity over the following weeks.

Frequently asked questions

Can opening an email infect my computer?

Simply opening an email in an updated mail app is very rarely enough. The danger comes from opening attachments, enabling content and clicking links.

How to Handle Email Attachments Safely: Which Files Are Risky

Are PDF attachments safe?

Mostly, in updated readers. The bigger risk is links inside PDFs that lead to phishing pages.

Why would a ZIP file have a password?

Legitimate senders sometimes do this, but attackers use passwords to stop email scanners inspecting the contents. Treat unexpected password-protected archives as suspicious.

Is it safe to open attachments on my phone?

Phones are less vulnerable to Windows malware, but HTML and PDF phishing works anywhere. The same checks apply.

Related: spot a phishing email, check if a file is safe before opening.

Sources

Keep reading