HTML Attachment Phishing: How Fake Login Files Steal Microsoft 365 Accounts

HTML Attachment Phishing: How Fake Login Files Steal Microsoft 365 Accounts
An employee receives an email about a secure document, voicemail, invoice, payroll notice, or shared file. Instead of a normal PDF or Word document, the message includes an attachment ending in .html or .htm.
The employee opens it. A polished Microsoft 365 sign-in page appears in the browser. It may display the employee's email address, company name, logo, or a familiar message such as "Your session expired." The page asks for a password and may continue into a multi-factor authentication prompt.
The page is not Microsoft 365.
It is a web page delivered as an email attachment.
That distinction is easy to miss. Most people associate an attachment with a document and a browser window with a website. An HTML attachment blurs those expectations. It can place a convincing login experience on the employee's computer, send the victim to another phishing stage, or use scripts and forms to capture information.
For small and midsize businesses, this is not a niche file-format problem. It is an identity-security decision. If the business does not have a legitimate reason to exchange HTML files by email, blocking or quarantining them may remove an entire class of avoidable phishing exposure.
Why HTML Attachment Phishing Matters Now
Microsoft's Q2 2026 email threat landscape report found that credential phishing accounted for 94% to 96% of payload-based attacks each month during the quarter. HTML attachments were the most common malicious payload type, representing 35% to 41% of monthly payload volume. HTML and PDF attachments together accounted for roughly 60% to 70%.
The percentages do not mean that every HTML file or PDF is malicious. They show where attackers are concentrating effort and why businesses should review how these attachment types are handled.
The financial context is also significant. The FBI's 2025 Internet Crime Report recorded 191,561 phishing or spoofing complaints and approximately $215.8 million in reported losses for that category. Business email compromise produced 24,768 complaints and approximately $3.05 billion in reported losses. Those figures describe reports submitted to IC3, not the full cost of cybercrime or SMB losses specifically, but they demonstrate how quickly identity-focused phishing can turn into financial fraud.
The buyer-relevant keyword cluster is clear: HTML attachment phishing, HTML file phishing, fake Microsoft 365 login attachment, Microsoft 365 credential theft, malicious email attachments, email attachment blocking, Defender for Office 365, phishing protection for small business, and Microsoft 365 security for SMBs.
These are not vanity keywords. They connect to a decision a business can make now: determine whether employees need HTML attachments, configure the mail system accordingly, and protect the accounts attackers want to steal.
What Is an HTML Attachment?
HTML is the markup language browsers use to display web pages. A file with an .html or .htm extension can contain headings, images, buttons, forms, links, styling, and scripts.
There are legitimate uses for HTML files. A developer may share a web prototype. A reporting system may export an interactive report. An archive may include a saved web page. Some specialized business workflows still generate HTML output.
But most employees do not need to receive standalone web pages through email.
That makes the file type attractive to attackers. The recipient is likely to be unfamiliar with it, while the browser can render it as a professional-looking page. The attacker can build the file to:
- imitate a Microsoft 365, Google Workspace, DocuSign, Adobe, payroll, banking, or file-sharing login
- display the recipient's email address or company branding
- hide a destination behind a button or script
- submit information to attacker-controlled infrastructure
- redirect the user through multiple staging pages
- load remote images or content that changes after delivery
- present an error and send the victim to a second login page
- use obfuscation to make automated analysis more difficult
- deliver another file or direct the user to run a command
The exact behavior varies by campaign. The business-level lesson does not: an HTML attachment can behave more like a web application than a document.
How the Attack Usually Works
Understanding the sequence helps employees and administrators recognize where controls can interrupt it.
1. The Email Creates a Familiar Business Reason
The lure usually resembles ordinary work:
- a voicemail notification
- a secure document or encrypted message
- an invoice, purchase order, or payment notice
- a payroll or benefits update
- a shared OneDrive or SharePoint file
- an e-signature request
- a fax or scanner notification
- an account expiration warning
- an HR, compliance, or policy notice
- a customer or vendor document
The message may arrive from a new domain, a compromised account, or an attacker-controlled domain with valid email authentication. Passing SPF or DKIM does not prove that the business purpose is legitimate; it can simply mean the sender was authorized to use that sending domain.
2. The Attachment Opens in a Browser
When the employee opens the file, the default browser may display it. That feels normal because browsers are trusted applications.
The address bar may show a local file: address, a downloaded-file path, or another unfamiliar location instead of https://login.microsoftonline.com/. Many users focus on the page design and do not inspect the address bar.
The page can look convincing even when it is running locally. Logos, colors, password fields, loading animations, security language, and company-specific details are easy to reproduce.
3. The Page Requests Credentials or Starts Another Stage
The attachment may ask directly for an email address and password. It may also redirect the employee to an attacker-controlled site, a CAPTCHA, a cloud-hosted page, or an adversary-in-the-middle phishing flow.
In an adversary-in-the-middle attack, the criminal proxies a real authentication process and attempts to capture credentials and an authenticated session. That can let the attacker reuse a session even after the employee completes conventional MFA.
An HTML attachment can also be a delivery step rather than the final credential page. It may lead to a malicious download, a fake browser update, a QR code, a device-code prompt, or instructions that persuade the employee to weaken the device.
4. The Attacker Uses the Account
Once access is obtained, the attacker may:
- read email and recent business conversations
- create inbox rules to hide warnings or replies
- impersonate the employee to coworkers, customers, and vendors
- search SharePoint, OneDrive, and Teams
- request invoice, payroll, or bank-detail changes
- approve or add connected applications
- steal sensitive files and customer information
- send more phishing from the trusted account
- establish persistence through sessions, authentication methods, or forwarding
- prepare for extortion, fraud, or a broader intrusion
The original email may look like a minor phishing attempt. The resulting access can become a Microsoft 365 incident affecting finance, operations, customers, and legal obligations.
Why Traditional Warning Signs Are Not Enough
Employees are often taught to hover over links before clicking. An HTML attachment may contain no visible link in the email body. The dangerous content begins after the file opens.
Other assumptions can fail too:
- "It opened in my browser, so it is a website." A browser can display a local attachment.
- "The page has our logo." Public logos and branding are easy to copy.
- "The email passed authentication." An attacker can authenticate mail sent from a domain they control or abuse a legitimate service.
- "There was no macro warning." HTML phishing does not need an Office macro.
- "MFA will stop it." MFA remains essential, but some phishing flows target session tokens or manipulate a real authentication process.
- "The attachment was scanned." Scanning helps, but layered defenses are needed because content, redirects, remote resources, and attacker infrastructure can change.
- "The sender knows our company." Company names, employees, vendors, and software platforms can be researched or obtained from earlier compromises.
Training should still cover warning signs, but the best control is to reduce how often employees must make this judgment.
The First Business Decision: Do You Need HTML Attachments?
Before buying another product, ask a simple question:
Which approved business process requires employees to receive .html or .htm files by email?
For many SMBs, the answer is none.
If there is no documented use case, blocking the file types is a reasonable default. If a limited team needs them, the business may be able to quarantine HTML attachments broadly and create a narrow, monitored exception for that workflow.
Do not make the decision from assumption alone. Check mail-flow data, ask application owners, talk to finance and operations, and identify systems that may send saved web reports. A control that silently breaks a payroll, customer, or reporting workflow creates pressure for broad exceptions later.
A practical review should record:
- who receives HTML attachments today
- which senders and applications generate them
- how often they arrive
- whether a secure portal or another format is available
- who owns each legitimate workflow
- whether the attachment must be opened or merely archived
- what exception, if any, is required
- when the exception will be reviewed again
The objective is not to block a file extension for appearances. It is to remove unnecessary risk without interrupting a real business process.
How Microsoft 365 Can Reduce HTML Attachment Risk
Microsoft 365 provides multiple controls, but they need to be configured and operated as a system.
1. Review the Common Attachments Filter
Microsoft documents a common attachments filter in anti-malware policies. Administrators can choose additional file types, including htm, html, mht, mhtml, and xhtml, and configure the action for messages that contain selected types.
The appropriate action depends on the business. Quarantine can support review and recovery during a pilot. Rejecting can give the sender a clear non-delivery response. The decision should account for legitimate workflow, user experience, quarantine permissions, support capacity, and false-positive handling.
Do not assume the default policy blocks HTML files. Verify the tenant's actual policy, selected file types, scope, priority, exceptions, and action.
2. Use Preset Security Policies Where They Fit
Microsoft's Standard and Strict preset security policies can provide a supported baseline across anti-spam, anti-phishing, anti-malware, Safe Links, and Safe Attachments settings.
The right policy depends on users, licensing, and business tolerance. High-risk accounts such as administrators, executives, finance, payroll, HR, and employees who can change payment details may justify stronger protection.
Preset policies still need ownership. Confirm who is included, whether exclusions exist, how quarantine works, and what happens when Microsoft changes recommended settings.
3. Configure Safe Attachments
Safe Attachments policies in Microsoft Defender for Office 365 can analyze email attachments in a virtual environment before delivery or apply other configured handling.
Availability and options depend on licensing. Verify the policy applies to the intended recipients and that administrators understand delivery behavior, dynamic delivery choices, quarantine, alerts, and exceptions.
Safe Attachments is valuable, but it does not eliminate the case for blocking a file type the business never needs.
4. Enable Safe Links and Browser Protection
An HTML file may redirect the user to another page or load remote content. Time-of-click URL protection, Microsoft Defender SmartScreen, endpoint network protection, DNS filtering, and secure web gateways can provide another opportunity to block the destination.
These controls should cover managed browsers and devices where practical. Employees should be trained not to bypass a browser warning simply because the email looked legitimate.
5. Make User Reporting Easy
Employees need a fast way to report the original message and attachment without forwarding it casually to coworkers.
Define:
- the report-phishing button or approved reporting method
- who monitors reports
- the expected response time
- how security searches for similar messages
- how confirmed threats are removed from other mailboxes
- when an account or endpoint investigation begins
- how the reporting employee receives feedback
Reporting should be praised even when the message turns out to be legitimate. Fast reporting gives the business a chance to protect other recipients.
Protect the Identity Behind the Inbox
Email controls reduce exposure. Identity controls reduce the impact when a message gets through.
Move High-Risk Users Toward Phishing-Resistant MFA
FIDO2 security keys, passkeys, and Windows Hello for Business can provide phishing-resistant authentication when deployed correctly. Prioritize administrators, owners, executives, finance, payroll, HR, and users with broad access.
Conventional MFA is still much better than no MFA. The improvement is to move the accounts with the greatest business impact toward methods designed to resist lookalike-site phishing.
Use Conditional Access Deliberately
Where licensing supports it, Conditional Access can help restrict access based on user, application, device state, location, risk, and authentication strength.
Policies should be designed and tested carefully. Poorly planned access rules can lock out legitimate users or leave gaps through excluded accounts and applications. Maintain protected emergency access accounts and a documented change process.
Reduce Persistent Privilege
An everyday mailbox should not also be a permanent Global Administrator account. Separate administrative identities, minimize standing privilege, and require stronger authentication for privileged actions.
If an employee opens a phishing attachment, the consequence should be limited by the access that identity actually needs.
Monitor Sessions and Post-Compromise Behavior
Look for more than failed passwords.
Useful signals may include:
- unfamiliar interactive or non-interactive sign-ins
- anomalous session or token activity
- new inbox rules or external forwarding
- unusual outbound email volume
- access from unexpected hosting providers or devices
- new authentication methods
- suspicious OAuth consent
- unusual SharePoint or OneDrive downloads
- messages sent to recent contacts
- security alerts deleted or marked as read
Detection should feed a response process with a named owner. An alert nobody reviews is not an operated security control.
What Employees Should Do With an HTML Attachment
Give employees a rule they can remember:
If an email attachment opens a login page, close it and report the message. Do not sign in.
Employees should also stop when:
- the attachment ends in
.htmlor.htmand they did not expect it - a document asks them to log in before showing its content
- the browser address begins with
file:or shows a local path - the page asks for credentials after a file was downloaded
- the message uses urgency involving payroll, voicemail, compliance, invoices, or account expiration
- the sender asks them to ignore a security warning
- the login page does not use the organization's known sign-in domain
- the attachment leads to an unexpected CAPTCHA, QR code, device code, or software download
Employees should verify the business request through a known channel. Contact the sender using a saved phone number, an existing Teams conversation, or a trusted portal—not contact details supplied by the suspicious message.
What to Do If Someone Opened the File
Opening the attachment does not automatically prove the account or computer is compromised. The response depends on what the file did and what the employee entered, approved, downloaded, or ran.
Ask the employee to stop and report exactly what happened:
- Was the attachment only opened?
- Did the employee enter an email address or password?
- Did the employee approve MFA or enter a one-time code?
- Did the page ask for a Microsoft device code?
- Was another file downloaded or opened?
- Did the employee run a command or install software?
- Did the employee see a browser or security warning?
- What device and browser were used?
- When did the activity occur?
Do not shame the employee. Accurate, immediate reporting is more valuable than a delayed story shaped by fear.
If credentials, MFA, or a session may have been exposed, the response may include:
- Contact the real IT or incident-response owner through a known channel.
- Contain or disable the affected account when active abuse is suspected.
- Revoke active sessions and refresh tokens.
- Reset the password through a trusted administrative process.
- Review registered MFA methods, devices, recovery information, and recent changes.
- Review sign-in logs, identity alerts, application consent, and administrative roles.
- Check mailbox rules, forwarding, delegation, sent mail, deleted items, and message trace.
- Review SharePoint, OneDrive, Teams, and connected SaaS activity.
- Investigate the endpoint if the file downloaded content, ran a command, or produced other suspicious behavior.
- Search for and remove similar messages across the organization.
- Preserve the original message, headers, attachment, URLs, timestamps, and response actions.
- Assess whether finance, customers, vendors, regulated data, insurers, or legal obligations are affected.
A password reset alone may be incomplete after session theft. The investigation should address the identity, mailbox, cloud data, applications, and endpoint based on evidence.
A 30-Day HTML Attachment Risk Reduction Plan
Week 1: Measure and Decide
- Review recent
.html,.htm,.mht,.mhtml, and.xhtmlemail traffic. - Identify legitimate senders, recipients, and application workflows.
- Ask business owners whether a secure portal, PDF, or another delivery method can replace the attachment.
- Document the proposed default action and any narrow exceptions.
- Confirm Microsoft 365 licensing and current threat policies.
Week 2: Configure and Test
- Create or update the attachment policy in a controlled change window.
- Pilot quarantine or rejection with an appropriate group.
- Confirm internal and external messages behave as expected.
- Test quarantine access, notifications, release approval, and support escalation.
- Validate that exceptions are narrow, named, and time-bound.
Week 3: Strengthen the Layers
- Review Safe Attachments and Safe Links coverage.
- Confirm browser, endpoint, DNS, and network protections are active on managed devices.
- Review MFA coverage and prioritize phishing-resistant methods for high-risk users.
- Check Conditional Access or Security Defaults.
- Verify alerts for inbox rules, forwarding, suspicious sign-ins, and unusual sending.
Week 4: Train and Exercise
- Show employees what an HTML attachment and local
file:address look like. - Teach the rule: attachment opens a login page, close and report.
- Test the reporting workflow with the help desk or MSP.
- Run a tabletop scenario involving a submitted password and stolen session.
- Measure blocked messages, false positives, reports, response time, and business impact.
- Schedule a quarterly policy and exception review.
The result should be an operated control, not a setting that disappears into the admin portal.
Questions to Ask Your IT Provider
Business leaders can use these questions to turn a technical topic into accountable risk management:
- Do we have a legitimate business need for HTML email attachments?
- Are
.htmland.htmblocked, rejected, quarantined, or allowed today? - Which users, domains, or applications are excluded from the policy?
- Who approves an exception, and when is it reviewed?
- Do our Microsoft 365 licenses include Safe Attachments and Safe Links?
- Which employees receive phishing-resistant MFA today?
- Can we revoke active sessions quickly after suspected credential theft?
- Who reviews reported phishing messages and identity alerts?
- Can we search for and remove a malicious attachment from other mailboxes?
- Does incident response include mailbox rules, OAuth applications, cloud files, Teams, and endpoints?
- How will we measure whether the change blocks attacks without disrupting business?
Clear answers matter more than a long list of product names.
How CybarWorks Can Help
CybarWorks helps small and midsize businesses turn Microsoft 365 security features into practical, maintained protection.
We can assess email attachment patterns, review anti-malware and Defender for Office 365 policies, test HTML attachment controls, validate Safe Attachments and Safe Links coverage, improve phishing reporting, strengthen MFA and Conditional Access, monitor suspicious account behavior, and build a Microsoft 365 compromise response process.
The goal is not to make every employee analyze web code. It is to remove file types the business does not need, give employees one safe action when a login page appears, and contain the damage if an account is targeted.
If you are unsure whether HTML attachments can reach your employees—or whether your Microsoft 365 security policies match current credential-phishing tactics—contact CybarWorks. We can help you review the risk, test the controls, and protect the business without breaking legitimate email workflows.
Frequently Asked Questions
What is HTML attachment phishing?
HTML attachment phishing uses an .html or .htm file delivered by email to display a fake login page, collect information, redirect the user to another phishing stage, or deliver additional malicious content. The file opens in a browser, which can make it feel like a legitimate website.
Are all HTML email attachments malicious?
No. Developers, reporting systems, archives, and specialized applications may use HTML files legitimately. The business should measure actual use and document required workflows before blocking them. Many SMBs, however, have little or no routine need to exchange standalone HTML files by email.
Can Microsoft 365 block HTML attachments?
Yes. Microsoft documents that administrators can add htm, html, and related formats to the common attachments filter in anti-malware policies, then configure how matching messages are handled. Administrators should verify scope, priority, action, exceptions, notifications, and business impact in their own tenant.
Will Safe Attachments stop every HTML phishing attack?
No single control stops every campaign. Safe Attachments can analyze files where licensing and policy support it, but businesses should also consider attachment blocking, Safe Links, browser and endpoint protection, phishing-resistant MFA, monitoring, employee reporting, and incident response.
What should an employee do if an attachment opens a Microsoft 365 login page?
Close the page and report the original email through the approved channel. Do not enter credentials or approve MFA. If anything was entered, approved, downloaded, or run, tell IT immediately so the account, session, mailbox, cloud activity, and device can be assessed.
Does MFA protect against HTML attachment phishing?
MFA materially reduces account risk and should be enabled. However, some phishing flows attempt to capture authenticated sessions or manipulate real authentication prompts. Phishing-resistant methods such as FIDO2 security keys, passkeys, and Windows Hello for Business provide stronger protection when deployed correctly.
Can CybarWorks review our Microsoft 365 attachment policies?
Yes. CybarWorks can review current mail flow, legitimate attachment use, anti-malware policies, Defender for Office 365 coverage, identity controls, alerting, user reporting, and account-compromise procedures, then help implement a practical policy for the business.
Works Cited
-
Microsoft Threat Intelligence and Microsoft Defender Security Research Team. (2026). Email Threat Landscape: Q2 2026 Trends and Insights
-
Microsoft Learn. (2026). Anti-Malware Protection for Email in Microsoft 365
-
Microsoft Learn. (2026). Set Up Safe Attachments Policies in Microsoft Defender for Office 365
-
Federal Bureau of Investigation. (2026). 2025 Internet Crime Report

