---
title: "Word as a Web Page: The Office Polyglot: How a Single File Web Page Carries Macros"
description: Word opens a renamed web page file as a document, macros included. APT32 sent such files with fake error messages to get macros enabled.
image: https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg
---

[customer login](https://www.bowbridge.net/customer-portal/) english deutsch

[![bowbridge](https://explore.bowbridge.net/hubfs/logos/bowbridge_logo.svg "bowbridge")](https://www.bowbridge.net/en/)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

- [DE](https://www.bowbridge.net/de/)
- [EN](https://www.bowbridge.net/en/news.html)

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/) 
    - [Anti-Virus - Cloud](https://www.bowbridge.net/en/anti-virus-cloud-for-sap-solutions/)
    - [Anti-Virus for SAP Solutions](https://www.bowbridge.net/en/anti-virus-for-sap-solutions/)
    - [Application Security for SAP Solutions](https://www.bowbridge.net/en/application-security-for-sap-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/) 
    - [Blog](https://explore.bowbridge.net/blog)
    - [Protecting SAP Applications from Content-Based Attacks](https://www.bowbridge.net/en/guide-to-content-based-attacks-sap-applications/)
    - [Intro to FIORI Cybersecurity](https://www.bowbridge.net/en/guide-to-sap-fiori-cybersecurity/)
    - [Case Studies](https://www.bowbridge.net/en/sap-cybersecurity-resources/#casestudies)
    - [White Papers](https://www.bowbridge.net/en/sap-cybersecurity-resources/#wp)
    - [Webinars](https://www.bowbridge.net/en/sap-cybersecurity-resources/#webinars)
    - [Partner Resources](https://www.bowbridge.net/en/bowbridge-partner-resources/)
- [About](https://www.bowbridge.net/en/about-bowbridge-software/) 
    - [Company Profile](https://www.bowbridge.net/en/company-profile/)
    - [Customers](https://www.bowbridge.net/en/customers/)
    - [News](https://explore.bowbridge.net/news)
    - [Careers](https://www.bowbridge.net/en/careers/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/) 
    - [Software Downloads](https://www.bowbridge.net/en/bowbridge-downloads/)
    - [Documentation](https://www.bowbridge.net/en/bowbridge-documentation/)
    - [Support Videos](https://www.bowbridge.net/en/bowbridge-support-videos/)
    - [Contact Technical Support](https://www.bowbridge.net/en/sap-cybersecurity-support/#form)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)

![File Security 101 – Threats Beyond Malware](https://explore.bowbridge.net/hs-fs/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg?width=1800&height=500&name=File%20Security%20101%20-%20Blog%20Header.jpeg)

# Word as a Web Page: The Office Polyglot: How a Single File Web Page Carries Macros

Nov 19, 2026, 2:33:47 PM by Joerg Schneider-Simon

A file named like a Word document can be a web page inside, and Word will still open it as a document, macros included. This is episode 9 of File Security 101, our series on file-based threats your anti-malware does not see.

<iframe class="hs-responsive-embed-iframe" src="https://www.youtube.com/embed/daFdy9owe_I?rel=0" title="File Security 101 – Ep 9 – Word as a Web Page – The Office Polyglot – How it works" style="position:absolute;top:0;left:0;width:100%;height:100%;border:none;" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

The video explains it in about two minutes.  
 The article adds the details and the research behind it.

## One file, many parts

Word can save any document as a "Single File Web Page". The result is an MHTML file (extension .mht or .mhtml). MHTML uses the same structure as an email: a `multipart/related` message whose parts are separated by a boundary line. The first part is the HTML a browser would display. Word's HTML is not plain HTML, though. It declares Office namespaces such as `urn:schemas-microsoft-com:office:office`, uses Office-specific elements and conditional comments, and links to a file list and to edit-time data.

Further parts hold what Word needs to restore the document: an XML part, and a Base64-encoded part of type `application/x-mso`. That part uses a format called ActiveMime: a short header that begins with the string "ActiveMime", followed by zlib-compressed data ([format notes](https://github.com/idiom/activemime-format)). When the document has macros, this is where they travel. Mandiant found that the "Base64 encoded ActiveMime data also contained an OLE file with malicious macros" ([Mandiant](https://cloud.google.com/blog/topics/threat-intelligence/cyber-espionage-apt32/)).

## The attack: rename it to DOC

The attacker writes a macro in a Word document, saves it as a single file web page and renames the result to .doc. Word does not trust the extension. It looks at the content, recognizes MHTML and opens the file as a document. Netskope noted that Word opens the format "even using the '.doc' extension" ([Netskope](https://www.netskope.com/blog/abusing-microsoft-office-using-malicious-web-archive-files)).

Macros still do not run on their own. The page therefore shows a fake error message, for example that the document was created in a newer version of Word and that content must be enabled to view it. One click on Enable Content runs the macro with the user's rights. From there it can download and install further malware.

## It happened

- **2017, APT32.** Mandiant reported spear-phishing lures that "had '.doc' file extensions" but "were ActiveMime '.mht' web page archives that contained text and images", likely created by exporting Word documents as single file web pages. Many showed fake error messages to get victims to enable macros; the macros then installed two backdoors ([Mandiant](https://cloud.google.com/blog/topics/threat-intelligence/cyber-espionage-apt32/)).
- **2022, Netskope.** Netskope Threat Labs analyzed RAR archives with MHT files that Word opened as documents. A password-protected, obfuscated macro dropped a DLL that collected system, network, file and process information and sent it to the attackers. Some samples were detected by only 7 to 10 engines on VirusTotal ([Netskope](https://www.netskope.com/blog/abusing-microsoft-office-using-malicious-web-archive-files)).
- **2023, MalDoc in PDF.** JPCERT/CC confirmed an attack in July 2023 in which an MHT file created in Word, with a macro, was appended to a PDF and named .doc. PDF tools saw a PDF; Word opened a document with a macro ([JPCERT/CC](https://blogs.jpcert.or.jp/en/2023/08/maldocinpdf.html)).

## Why it slips through

This file does contain malicious code. It is hard to see because it is wrapped twice: compressed inside ActiveMime, then Base64-encoded inside a part of what looks like a web page or, in the MalDoc in PDF variant, a PDF. A filter that decides by file type checks HTML or a PDF, not a Word document with macros. JPCERT/CC wrote that "since the file is recognized as a PDF file, existing sandbox or antivirus software may not detect it". Netskope also found that common analysis tools could not extract the macro code from the samples it studied.

## What to do

- Keep macros blocked for files from the internet. In Microsoft 365 Apps for enterprise, this is the policy "Block macros from running in Office files from the Internet" ([Microsoft](https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked)).
- In Word's File Block settings, the entry "Web pages" covers .htm, .html, .mht and .mhtml. Set it to open such files in Protected View, or block them if you do not need them ([Microsoft](https://learn.microsoft.com/en-us/previous-versions/office/office-2013-resource-kit/cc179230(v=office.15))).
- Analyze suspicious documents with a tool that extracts macros from all containers, such as olevba, which JPCERT/CC names as effective for MalDoc in PDF.

bowbridge Content Disarm and Reconstruct rebuilds a Word web page as plain HTML that keeps its text. The Office namespaces and elements, the conditional comments, the links to the file list and the edit-time data, the XML part and the ActiveMime part are not copied, so there is no macro left for Word to find.

[Join the bowbridge CDR beta program](https://explore.bowbridge.net/en/cdr-beta)

## Sources

- [Cyber Espionage is Alive and Well: APT32 and the Threat to Global Corporations](https://cloud.google.com/blog/topics/threat-intelligence/cyber-espionage-apt32/), Mandiant (Nick Carr), May 14, 2017
- [Abusing Microsoft Office Using Malicious Web Archive Files](https://www.netskope.com/blog/abusing-microsoft-office-using-malicious-web-archive-files), Netskope Threat Labs (Gustavo Palazolo), January 12, 2022
- [MalDoc in PDF - Detection bypass by embedding a malicious Word file into a PDF file](https://blogs.jpcert.or.jp/en/2023/08/maldocinpdf.html), JPCERT/CC, August 28, 2023
- [ActiveMime format notes](https://github.com/idiom/activemime-format), GitHub (idiom)
- [Macros from the internet are blocked by default in Office](https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked), Microsoft Learn
- [Plan file block settings for Office 2013](https://learn.microsoft.com/en-us/previous-versions/office/office-2013-resource-kit/cc179230(v=office.15)), Microsoft Learn

## Subscribe to upcoming episodes

#### Share this on social:

[Share via LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-9-word-as-a-web-page-the-office-polyglot&title=Word+as+a+Web+Page%3A+The+Office+Polyglot%3A+How+a+Single+File+Web+Page+Carries+Macros&summary=Word+opens+a+renamed+web+page+file+as+a+document%2C+macros+included.+APT32+sent+such+files+with+fake+error+messages+to+get+macros+enabled.) [Share via Twitter](https://twitter.com/intent/tweet?url=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-9-word-as-a-web-page-the-office-polyglot&text=Word+as+a+Web+Page%3A+The+Office+Polyglot%3A+How+a+Single+File+Web+Page+Carries+Macros) [Share via Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-9-word-as-a-web-page-the-office-polyglot) [Share via Email](mailto:?subject=Word+as+a+Web+Page%3A+The+Office+Polyglot%3A+How+a+Single+File+Web+Page+Carries+Macros&body=https%3A%2F%2Fexplore.bowbridge.net%2Ffile-security-101%2Fepisode-9-word-as-a-web-page-the-office-polyglot)

### Don't miss the latest SAP security news

#### bowbridge

- [Solutions](https://www.bowbridge.net/en/sap-cybersecurity-solutions/)
- [Resources](https://www.bowbridge.net/en/sap-cybersecurity-resources/)
- [About bowbridge](https://www.bowbridge.net/en/about-bowbridge-software/)
- [Support](https://www.bowbridge.net/en/sap-cybersecurity-support/)
- [Contact](https://www.bowbridge.net/en/contact-bowbridge/)
- [Customer Login](https://www.bowbridge.net/customer-portal/)

#### Contact

**GERMANY**  
 Tel: +49 (0) 6227 - 69899 - 50  
 Fax: +49 (0) 6227 - 69899-59  
 Email: [info@bowbridge.net](mailto:info@bowbridge.net)

**USA**  
 Tel: +1 650 - 617 - 3408  
 Fax: +1 650 - 617 - 3201  
 Email: [us-sales@bowbridge.net](mailto:us-sales@bowbridge.net)

#### Connect With Us

<https://www.linkedin.com/company/bowbridge-software/> <https://twitter.com/bowbridge_Softw> <https://www.xing.com/companies/bowbridgesoftware>

- [English](https://www.bowbridge.net/en/)
- [Deutsch](https://www.bowbridge.net/)

Copyright © 2023 bowbridge Software GmbH. All rights reserved. [Privacy Policy](https://www.bowbridge.net/en/privacy-policy)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Joerg Schneider-Simon",
    "url" : "https://explore.bowbridge.net/file-security-101/author/joerg-schneider-simon"
  },
  "dateModified" : "2026-11-19T13:33:47.503Z",
  "datePublished" : "2026-11-19T13:33:47.000Z",
  "headline" : "Word as a Web Page: The Office Polyglot: How a Single File Web Page Carries Macros",
  "image" : [ "https://explore.bowbridge.net/hubfs/Blog/File%20Security%20101/Headers/File%20Security%20101%20-%20Blog%20Header.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://explore.bowbridge.net/file-security-101/episode-9-word-as-a-web-page-the-office-polyglot",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://explore.bowbridge.net/hubfs/bowbridge_logo_2-1.png"
    },
    "name" : "bowbridge Software GmbH"
  }
}
```