Join our Newsletter — 33% off our NHI Course
Home› Guides› Password-Protected Attachment Evasion Guide: Encrypted ZIPs and PDFs…
Guide Email & Communications Security

Password-Protected Attachment Evasion Guide: Encrypted ZIPs and PDFs That Blind Scanners

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 14 min read
On this page

An attachment that is encrypted with a password cannot be opened by the email gateway, so signature engines, content rules and sandboxes see an opaque blob and, unless told otherwise, let it through. Attackers know this and pair a password protected ZIP, 7z, PDF or Office file with the password written in the message body, leaving the user as the only party able to unlock the payload. This guide explains why encryption blinds inspection, which file types and lures defenders see, what gateway and API based email platforms can do about it, and how to set a policy that blocks, quarantines or warns without breaking legitimate business use. It is written for email security engineers and SOC analysts. It is defensive throughout: it describes the pattern so it can be detected, not how to build it.

Key takeaways

  • Uninspectable means unverified: an encrypted attachment has not been scanned, so treat "could not scan" as a risk decision, never as a clean verdict.
  • The password in the body is the tell: MITRE ATT&CK T1566.001 notes that phishing emails may include instructions to decrypt an attachment, such as a zip file password, to evade email boundary defences; that pairing is a strong detection signal.
  • Every major platform can flag it: Exchange Online mail flow rules have an "Any attachment is password protected" condition and Google Workspace has "Protect against encrypted attachments from untrusted senders"; both need to be turned up from their defaults to do much.
  • Quarantine plus a release path beats a blanket block: finance, legal and HR genuinely exchange encrypted files, so pair strict handling for external senders with an approved alternative channel and a fast, logged release process.
  • The endpoint is the last layer: if the file gets through and the user opens it, macro blocking, attack surface reduction, Mark of the Web and EDR decide the outcome, so plan for that layer too.

Why encrypted attachments evade scanning

Email security engines work on the bytes of a file. Signature and reputation checks hash or pattern match the content, content rules extract text, and sandboxes open the file in a virtual machine and watch it. Encryption removes all three. A password protected archive shows its file headers but not the content of its members; an encrypted PDF or Office document will not render without the key. ATT&CK describes this under T1027.013 Encrypted/Encoded File, a sub-technique of T1027 Obfuscated Files or Information, noting that adversaries may abuse password protected Word documents or self-extracting archives to encrypt a phishing payload, and that encryption can cause a lapse in detection of static signatures until the content is revealed at execution time (T1140 Deobfuscate/Decode Files or Information).

The technique sits inside the delivery chain described by T1566.001 Spearphishing Attachment, which relies on T1204 User Execution: the user must open the archive, type the password and run what is inside. That reliance is the defender's opportunity. The attacker has to explain the password somewhere the user will read it, which is usually the email body, a follow-up message or an image, and has to persuade the user to take several deliberate steps.

Inspection layerWhat it normally doesEffect of encryption
Signature and hash reputationMatches known malicious files and content patternsOnly the outer container is visible; the inner payload hash is unknown
True file type detectionIdentifies the real format regardless of extensionStill works on the container (it is a ZIP, a 7z, a PDF), which is what makes policy on encrypted files possible
Content and DLP rulesExtract text and match keywords or sensitive dataNothing to extract; Exchange Online raises a separate "content can't be inspected" condition
Sandbox detonationOpens or runs the file and scores behaviourCannot open the file unless the platform finds or is given the password

For the wider family of obfuscation techniques see the T1027 Obfuscated Files or Information Defensive Guide.

Common file types and lures (described defensively)

Defenders mostly meet four container types. The list explains what to recognise and tune for, not how to produce them.

  • Encrypted archives (ZIP, 7z, RAR): the most common form. The archive often holds a script, shortcut, executable or macro document, sometimes inside a second archive or disk image. Exchange Online password detection covers .zip and .7z; check how your platform handles RAR and nested archives.
  • Encrypted PDFs: a document that needs a password to open, typically showing a link or a further instruction once unlocked, so the threat moves from file to URL.
  • Password protected Office documents: Word or Excel files encrypted with a password, often carrying macros. Office macro controls still apply once opened. See the Office Macro Blocking Guide.
  • Self-extracting archives: named by ATT&CK under T1027.013 as a way to wrap an encrypted payload in an executable stub. They are executables and should be caught by file type blocking before encryption matters.

The lures are ordinary business pretexts: invoices, remittance advice, contracts, payroll and HR letters, shipping notices and replies in hijacked threads. The password is presented as a security feature ("protected for your privacy"), which borrows legitimacy from genuine secure document practice. Commodity loaders have used this pattern repeatedly; see the Emotet Malware Guide and the QakBot Malware Guide for campaign context. Closely related evasion via browser-assembled files is covered in the HTML Smuggling Guide.

Gateway and API email security controls

Secure email gateways sit in the mail flow and can reject or hold a message before delivery; integrated cloud email security (API) tools read the mailbox and remove or banner messages after delivery. Both can act on encrypted attachments, with different timing. See ICES vs Secure Email Gateway for the architecture choice. Platforms below are listed alphabetically; the order is not a ranking.

Google Workspace

Gmail's advanced phishing and malware protection includes a setting named "Protect against encrypted attachments from untrusted senders", described as protection against attackers who use encrypted attachments, which can't be scanned for malware. The available actions are "Keep email in inbox and show warning" (the default), "Move email to spam" and "Quarantine". The same section has "Protect against attachment with scripts from untrusted senders" and "Protect against anomalous attachment types in emails", the latter with an allowlist for approved uncommon types. Security Sandbox, where available, scans files inside zip and rar archives, but like any sandbox it cannot open an encrypted one, so these settings carry the load.

Microsoft Exchange Online and Defender for Office 365

Mail flow rules (transport rules) have the condition "Any attachment is password protected" (PowerShell parameter AttachmentIsPasswordProtected, with the exception ExceptIfAttachmentIsPasswordProtected). Microsoft documents that password detection works for Office documents, .zip and .7z archives and .pdf files. A second condition, "Any attachment's content can't be inspected" (AttachmentIsUnsupported), catches file types the rules engine cannot read. Rule actions include quarantine, redirect to a review mailbox, prepending a disclaimer or setting the spam confidence level. Anti-malware policies add the common attachments filter, which blocks listed file types using best effort true type matching rather than the extension, and zero-hour auto purge (on by default) removes delivered mail later found to be malicious.

Control options compared

ControlWhat it does with encrypted filesStrengthTrade-off
Block all encrypted attachments (reject)Refuses any message carrying oneRemoves the vector entirelyBreaks legitimate exchanges; senders retry by other routes; generates help desk load
Quarantine with admin or user releaseHolds the message for reviewKeeps evidence, allows business exceptionsNeeds staffed review and clear release criteria, or users learn to ask for everything
Warning banner and deliverDelivers with a visible cautionLow frictionRelies on the user; the default in Gmail, weak alone for high risk groups
Password extraction and re-scanTries passwords found in the message, then scansRestores inspection for the common patternMisses passwords sent separately or in images; vendor support varies
File type blocking inside archivesBlocks executables and scripts even when nestedStops many payloads before encryption mattersEncrypted member names may still be visible, contents are not; needs true type detection
Sender scoping (trusted partners only)Allows encrypted files from known, authenticated domainsSupports real business flowsCompromised partner mailboxes inherit the trust; pair with DMARC alignment checks
Approved secure exchange channelReplaces encrypted email attachments with a managed file share or portalFiles are scanned at rest and access is loggedRequires partner adoption and a supported tool

Sandboxing, password extraction and their limits

Several gateway products try to recover inspection by reading the message body for candidate passwords (words near "password", short alphanumeric strings), trying them against the archive and, on success, sending the contents to normal scanning and detonation. This is a useful layer and worth enabling where your product supports it, but its limits should drive policy.

  • Out-of-band passwords: a password sent in a second email, a chat message or by phone is not in the message being scanned.
  • Passwords in images: unless the platform runs OCR on body images, a password rendered as a picture is missed. Exchange Online mail flow rules do extract text from images with OCR for content conditions, but that is not the same as feeding a password to an archive decryptor.
  • Nested and staged content: an archive inside an archive, or a decrypted document that only holds a link, moves the threat to a later stage. Content inspection in Exchange Online covers only the first 2 MB of extracted text, and legacy 97-2003 Office files are not recursively inspected for embedded files.
  • Sandbox evasion after decryption: once opened, the payload faces the usual sandbox, with the usual evasion risks. See Attachment Sandboxing vs CDR; content disarm and reconstruction cannot rebuild an encrypted file either.

Policy options: block, quarantine, warn

Write the policy before configuring the platform, so exceptions are decided once rather than ticket by ticket.

  1. Inventory real use (two weeks, audit mode): create the detection rule with a non-blocking action (an incident report or header stamp) and measure who sends and receives encrypted attachments, from which external domains, and which file types.
  2. Set a default by direction: inbound from external senders, quarantine encrypted archives and documents. Internal to internal, warn or allow. Outbound is a data protection question for your DLP policy, not this one.
  3. Define business need exceptions: an exception names the business owner, the partner domain(s), the file types, an expiry date and the compensating controls (DMARC pass required, sender authentication aligned, recipients limited to a group). Review exceptions quarterly.
  4. Offer the alternative: publish an approved secure file exchange route so partners have somewhere to go when encrypted email is refused, and say so in the rejection or quarantine notice.
  5. Define release criteria: reviewers release only when the sender is verified out of band through a known contact, the business context matches, and the file is scanned after decryption in an isolated environment. Log every release.
  6. Tighten for high risk groups: finance, payroll, executives and their assistants get quarantine without user self-release.
  7. Pilot, then enforce: move one department at a time from audit to quarantine, watch release requests and false positives, then go organisation wide. Roll back by switching the rule action back to report only, which keeps the detection in place.

Decision guidance: a small organisation without a staffed quarantine is usually better served by blocking external encrypted archives outright and naming the alternative channel, because an unreviewed quarantine becomes a release-on-request queue. A large organisation with a SOC and partner exchanges should quarantine with release criteria and scoped exceptions. Executable and script types should be blocked everywhere, encrypted or not.

Detection signals and metrics

Even with a strict policy, hunt for the pattern, because it marks campaigns that may reach other channels.

SignalWhere to see itWhy it matters
Encrypted attachment plus "password" or a short code in the bodyGateway logs, mail flow rule hits, API tool verdictsThe pairing ATT&CK T1566.001 describes; legitimate senders usually share passwords out of band
First-time external sender with an encrypted attachmentMessage trace joined with sender historyUnknown sender plus uninspectable content is the highest risk combination
Reply into an existing thread from a changed sending infrastructureHeader analysis, authentication resultsThread hijacking gives encrypted lures credibility
Archive extraction followed by script or shortcut executionEDR process trees (archive tool spawning a script host)Shows the payload ran despite email controls
Same container hash or file name to many recipientsGateway campaign viewsEnables bulk purge and blocking of repeats

Metrics that show the control is working:

  • Encrypted inbound volume: messages per week with encrypted attachments from external senders, split by quarantined, released, blocked and delivered.
  • Release rate and time: percentage of quarantined items released, and median time to release; a high release rate means the policy or exceptions need tuning.
  • Exception hygiene: number of active exceptions and percentage reviewed before expiry.
  • User reporting: share of encrypted lure messages reported by users before any automated action, which the NCSC recommends tracking alongside clicks.
  • Endpoint catch rate: EDR detections that trace back to an encrypted email attachment, a measure of what got past email controls.

User guidance and reporting

Users need one simple rule: an unexpected attachment that asks for a password is a reason to stop and report, not a sign of security. Messages to staff should cover three points.

  • Recognise: a password supplied in the same email as the file protects nothing from the person who sent it; genuine partners usually agree passwords separately or use a portal.
  • Verify: contact the sender through a known number or address, not one in the message, before opening anything.
  • Report: use the report button, even after opening the file. The NCSC's phishing guidance stresses a clear, quick reporting process, feedback to reporters, and not reprimanding users who are caught out.

Training is one layer among several, as the NCSC puts it, so keep the technical controls doing most of the work. See the How to Spot a Phishing Email Guide for awareness material.

Framework mapping

FrameworkReferenceRelevance
MITRE ATT&CKT1566.001 Spearphishing Attachment; T1027.013 Encrypted/Encoded File; T1204.002 Malicious File; T1140 Deobfuscate/Decode Files or InformationDelivery, evasion and execution steps of the pattern
MITRE ATT&CK mitigationsM1049 Antivirus/Antimalware; M1031 Network Intrusion Prevention; M1021 Restrict Web-Based Content; M1017 User TrainingLayered controls against the delivery step
MITRE D3FENDD3-DA Dynamic Analysis; D3-CNR Content Rebuild; D3-FA File AnalysisControls that need decrypted content to work
NIST SP 800-53 Rev. 5SI-3 Malicious Code Protection; SI-8 Spam Protection; SC-44 Detonation Chambers; SC-7 Boundary Protection; AT-2 Literacy Training and AwarenessControl baseline for email malware defence
NIST CSF 2.0PR.PS-05; DE.CM-09; DE.AE-02; PR.AT-01Prevent execution, monitor and analyse, train users

Common failure patterns

  • Leaving defaults in place: Gmail's default for encrypted attachments from untrusted senders is a warning with delivery, and an Exchange Online tenant has no password protected attachment rule until someone creates one.
  • Treating "unscannable" as clean: some gateway configurations log a scan failure and deliver; check what yours does with files it cannot open.
  • Self-release for everyone: letting users release their own quarantined encrypted files turns the control into a click-through.
  • Permanent partner exceptions: trusting a domain forever means a compromised partner mailbox delivers straight past the policy.
  • No endpoint backstop: files released or missed still need macro blocking, Mark of the Web handling and EDR; see the Mark of the Web Guide.

Practitioner checklist

  • Confirm how your email platform handles attachments it cannot decrypt or scan, and document the default.
  • Create a detection rule for password protected attachments in report-only mode and measure two weeks of traffic.
  • Block executable, script and shortcut types inside archives using true type detection.
  • Quarantine encrypted attachments from external senders, with no user self-release for high risk groups.
  • Enable password extraction and re-scan if your product supports it, and test it with benign samples.
  • Write the exception process: owner, partner domain, file types, expiry, DMARC pass required.
  • Publish an approved secure file exchange alternative and reference it in quarantine notices.
  • Add a hunting query for encrypted attachments with passwords in the body and for archive tools spawning script hosts.
  • Report the five metrics monthly and review exceptions quarterly.

Standards and references

Related NHI Mgmt Group resources: Email Security Guide · Attachment Sandboxing vs CDR · MITRE ATT&CK T1566 Phishing · HTML Smuggling Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.