<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=MHTML</id>
	<title>MHTML - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=MHTML"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=MHTML&amp;action=history"/>
	<updated>2026-04-20T11:50:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=MHTML&amp;diff=549627&amp;oldid=prev</id>
		<title>imported&gt;Mrqwerty567: /* Exploits */ fixed dead link for ref 8</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=MHTML&amp;diff=549627&amp;oldid=prev"/>
		<updated>2025-10-13T00:50:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Exploits: &lt;/span&gt; fixed dead link for ref 8&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{short description|Web page archive (file) format}}&lt;br /&gt;
{{more citations needed|date=April 2014}}&lt;br /&gt;
{{Infobox file format&lt;br /&gt;
| name = MHTML&lt;br /&gt;
| icon =&lt;br /&gt;
| screenshot =&lt;br /&gt;
| extension = .mht, .mhtml&lt;br /&gt;
| mime = {{ubl|class=nowrap|multipart/related|application/x-mimearchive|message/rfc822}}&lt;br /&gt;
| type code =&lt;br /&gt;
| uniform type =&lt;br /&gt;
| owner =&lt;br /&gt;
| genre = [[Markup language]]&lt;br /&gt;
| container for =&lt;br /&gt;
| contained by =&lt;br /&gt;
| extended from = [[HTML]]&lt;br /&gt;
| extended to =&lt;br /&gt;
| standard = {{nowrap|RFC 2557 {{smaller|(proposed 1999)}}}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;MHTML&amp;#039;&amp;#039;&amp;#039;, an [[initialism]] of &amp;quot;[[MIME]] encapsulation of aggregate [[HTML]] documents&amp;quot;, is a [[List of web archiving file formats|web archiving file format]] used to combine, in a single [[computer file]], the HTML code and its companion resources (such as images) that are represented by external [[hyperlink]]s in the web page&amp;#039;s HTML code. The content of an MHTML file is encoded using the same techniques that were first developed for [[HTML email]] messages, using the MIME content type &amp;lt;code&amp;gt;multipart/related&amp;lt;/code&amp;gt;.&amp;lt;ref&amp;gt;{{cite web |first=Amanda |last=Holden |title=Difference of HTML &amp;amp; MHTML |url=https://www.techwalla.com/articles/difference-of-html-mhtml |access-date=17 November 2017 |archive-url=https://web.archive.org/web/20171117122700/https://www.techwalla.com/articles/difference-of-html-mhtml |archive-date=17 November 2017 |url-status=dead}}&amp;lt;/ref&amp;gt; MHTML files use an &amp;lt;code&amp;gt;.mhtml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.mht&amp;lt;/code&amp;gt; [[filename extension]].&lt;br /&gt;
&lt;br /&gt;
The first part of the file is an [[e-mail header]]. The second part is normally HTML code. Subsequent parts are additional resources identified by their original [[URL|uniform resource locator]]s (URLs) and encoded in [[base64]] [[binary-to-text encoding]]. MHTML was proposed as an open standard, then circulated in a revised edition in 1999 as RFC 2557.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;.mhtml&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[Email#Filename extensions|.eml]]&amp;lt;/code&amp;gt; filename extensions are interchangeable: either filename extension can be changed from one to the other. An .eml message can be sent by e-mail, and it can be displayed by an [[email client]]. An email message can be saved using a &amp;lt;code&amp;gt;.mhtml&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.mht&amp;lt;/code&amp;gt; filename extension and then opened for display in a [[web browser]] or for editing other programs, including [[word processor]]s and [[text editor]]s.&lt;br /&gt;
&lt;br /&gt;
== Layout ==&lt;br /&gt;
The header of an MHTML file contains [[Metadata#File metadata|metadata]] such as a [[time stamp|date and time stamp]], page title, the source URL, and a unique randomized boundary string for separating resources contained within the file. The boundary string is defined at the beginning and used throughout the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;email&amp;quot;&amp;gt;&lt;br /&gt;
From: &amp;lt;Saved by Blink&amp;gt;&lt;br /&gt;
Snapshot-Content-Location: https://en.wikipedia.org/wiki/Smartphone&lt;br /&gt;
Subject: Smartphone - Wikipedia&lt;br /&gt;
Date: Sat, 24 Sep 2022 00:34:32 -0000&lt;br /&gt;
MIME-Version: 1.0&lt;br /&gt;
Content-Type: multipart/related;&lt;br /&gt;
        type=&amp;quot;text/html&amp;quot;;&lt;br /&gt;
        boundary=&amp;quot;----MultipartBoundary--GsIBda0vjy2AKIAIliwl7JMwezXDRjDAsLje9khd5l----&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the page resources are contained sequentially, starting with the page&amp;#039;s rendered HTML source code. Each resource has its own metadata header which specifies its [[MIME type]] and the original location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;email&amp;quot;&amp;gt;&lt;br /&gt;
------MultipartBoundary--GsIBda0vjy2AKIAIliwl7JMwezXDRjDAsLje9khd5l----&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Content-ID: &amp;lt;frame-D968CEC8BB7E60A1859261A8CA5DFB4D@mhtml.blink&amp;gt;&lt;br /&gt;
Content-Transfer-Encoding: binary&lt;br /&gt;
Content-Location: https://en.wikipedia.org/wiki/Smartphone&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MHTML file ends with a boundary string that is not followed by any data.&amp;lt;ref&amp;gt;{{cite web |title=2. The MHTML File Format - Hunchly Knowledge Base |url=https://support.hunch.ly/article/51-1-the-mhtml-file-format |website=support.hunch.ly |access-date=24 September 2022 |date=October 17, 2018}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MIME type ==&lt;br /&gt;
MIME type for MHTML is not well agreed upon. Used MIME types include:&lt;br /&gt;
* &amp;lt;code&amp;gt;multipart/related&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;application/x-mimearchive&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;message/rfc822&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Supporting apps ==&lt;br /&gt;
=== Web browsers ===&lt;br /&gt;
Some browsers support the MHTML format, either directly or through third-party extensions, but the process for saving a web page along with its resources as an MHTML file is not standardized. Due to this, a web page saved as an MHTML file using one browser may render differently on another.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Internet Explorer 5]]&amp;#039;&amp;#039;&amp;#039; was the first browser to support reading and saving web pages and external resources to a single MHTML file.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Microsoft Edge]]&amp;#039;&amp;#039;&amp;#039;, after switching to the Chromium source code, supports saving web pages as MHTML.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Opera (web browser)|Opera]]:&amp;#039;&amp;#039;&amp;#039; Support for saving web pages as MHTML files was made available in the Opera 9.0 web browser.&amp;lt;ref&amp;gt;{{cite web|url=http://my.opera.com/desktopteam/blog/show.dml/172375 |title=…and one more weekly! |last=Santambrogio |first=Claudio |date=10 March 2006 |publisher=[[Opera Software]] |access-date=2009-05-15 |archive-url=https://web.archive.org/web/20100115001636/http://my.opera.com/desktopteam/blog/show.dml/172375 |archive-date=15 January 2010 |url-status=dead }}&amp;lt;/ref&amp;gt; From Opera 9.50 through the rest of the Presto-based Opera product line (version 12.16 as of 19 July 2013), the default format for saving pages is MHTML. The initial release of the new Webkit/Blink-based Opera (version 15) did not support MHTML, but subsequent releases (16 and later) do. MHTML can be enabled by typing &amp;quot;&amp;lt;code&amp;gt;opera://flags#save-page-as-mhtml&amp;lt;/code&amp;gt;&amp;quot; at the address bar.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Google Chrome]] 86&amp;#039;&amp;#039;&amp;#039; and later can create MHTML files.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Yandex Browser]] 22.7.4.960&amp;#039;&amp;#039;&amp;#039; (July 2022) and later can create MHTML (multipart/related) files.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Vivaldi (web browser)|Vivaldi]] 2.3 and later&amp;#039;&amp;#039;&amp;#039; can create MHTML files.&amp;lt;ref&amp;gt;{{Cite web|url=https://vivaldi.com/fr/blog/auto-stacking-tabs/|title=Vivaldi Update {{!}} Auto-Stacking Tabs|last1=février 6|first1=Publié sur|last2=Tetzchner|first2=2019-Par Jon von|date=2019-02-06|website=Vivaldi|language=fr|access-date=2019-05-16}}&amp;lt;/ref&amp;gt; It supports both reading and writing MHTML files by toggling the &amp;quot;&amp;lt;code&amp;gt;vivaldi://flags/#save-page-as-mhtml&amp;lt;/code&amp;gt;&amp;quot; option.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Firefox]]&amp;#039;&amp;#039;&amp;#039; does not support MHTML.&amp;lt;ref&amp;gt;{{cite web|title=Bug 40873 - Save as rfc 2557 MHTML; complete webpage in one file|url=https://bugzilla.mozilla.org/show_bug.cgi?id=40873}}&amp;lt;/ref&amp;gt; Until [[Firefox version history#Firefox 52 through 59|version 57 (&amp;quot;Firefox Quantum&amp;quot;)]], two [[browser extension]], Mozilla Archive Format or UnMHT, could read and write MHTML files. These extensions are incompatible with version 57 and later.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Safari (web browser)|Safari]] 3.1.1 and later&amp;#039;&amp;#039;&amp;#039; terminated native support for the MHTML format. Instead, the browser supports the [[Web Archive (file format)|Web Archive]] format. The [[macOS]] version includes a print-to-[[PDF]] feature. As with most other modern web browsers, support for MHTML files can be added to Safari via various third-party extensions.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Konqueror]] 3.5.7 and later&amp;#039;&amp;#039;&amp;#039; terminated support for MHTML files. An extension project, &amp;lt;code&amp;gt;mhtconv&amp;lt;/code&amp;gt;, can be used to allow saving and viewing of MHTML files.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[NetFront]] 3.4&amp;#039;&amp;#039;&amp;#039; (on devices such as the Sony Ericsson [[K850]]) can view and save MHTML files.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Pale Moon (web browser)|Pale Moon]]&amp;#039;&amp;#039;&amp;#039; requires an extension to be installed to read and write MHT files. One extension is freely available, MozArchiver, a fork of Mozilla Archive Format extension.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[GNOME Web]]&amp;#039;&amp;#039;&amp;#039; added support for read and save web pages in MHTML since version 3.14.1 released in September 2014.&amp;lt;ref&amp;gt;{{Cite web|url=https://gitlab.gnome.org/GNOME/epiphany/blob/master/NEWS#L1061|title = NEWS · master · GNOME / Epiphany| date=28 July 2023 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other apps ===&lt;br /&gt;
* [[Problem Steps Recorder]] for Windows can save its output to MHT format.&lt;br /&gt;
* The &amp;quot;Save to Google Drive&amp;quot; extension for [[Google Chrome]] can save as MHTML as one of its outputs.&lt;br /&gt;
* [[Microsoft OneNote]] 2010 and later can email individual pages as .mht files.&lt;br /&gt;
* [[Evernote]] for Windows can export notes as MHT format, as an alternative to HTML or its own native .enex format.&lt;br /&gt;
&lt;br /&gt;
== Exploits ==&lt;br /&gt;
In May 2015, a researcher noted that attackers could build malicious documents by creating an MHT file, appending an MSO object at the end (MSO is a file format used by the [[Microsoft Outlook]] e-mail application), and renaming the resulting file with a .doc extension.&amp;lt;ref&amp;gt;{{Cite web|url=https://www.securityweek.com/attackers-hide-malicious-macros-mhtml-documents|title=Attackers Hide Malicious Macros in MHTML Documents|last=Kovacs|first=Eduard|date=May 11, 2015|website=SecurityWeek.Com|access-date=April 19, 2019}}&amp;lt;/ref&amp;gt; The delivery method would be by spam emails.&amp;lt;ref&amp;gt;{{Cite web |last=Mosuela |first=Lordian |date=July 10, 2015 |title=New Tricks of Macro Malware |url=https://www.cyren.com/blog/articles/new-tricks-of-macro-malware |url-status=dead |archive-url=https://web.archive.org/web/20240908105634/https://data443.com/blog/cyren/new-tricks-of-macro-malware/ |archive-date=September 8, 2024 |access-date=April 19, 2019 |website=Cyren |language=en}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In April 2019, a security researcher published details about an [[XML external entity attack|XML external entity (XXE) vulnerability]] that could be exploited when a user opens an MHT file. Since the Windows operating system is set to automatically open all MHT files, by default, in Internet Explorer, the exploit could be triggered when a user double-clicked on a file that they received via email, instant messaging, or another vector, including a different browser.&amp;lt;ref&amp;gt;{{Cite web|url=https://www.zdnet.com/article/internet-explorer-zero-day-lets-hackers-steal-files-from-windows-pcs/|title=Internet Explorer zero-day lets hackers steal files from Windows PCs|last=Cimpanu|first=Catalin|date=April 12, 2019|website=[[ZDNet]]|language=en|access-date=April 19, 2019}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
=== Data URI scheme ===&lt;br /&gt;
The [[data URI scheme]] offers an alternative for including separate elements such as images,  [[Style sheet (web development)|style-sheets]] and scripts in-line when serving an HTML request or saving an HTML resource for offline use. Like the embedded content within MHTML, data URIs use [[Base64]] encoding of the external resources (which may be binary or text) to embed them in-line within the HTML markup. HTML pages saved with external elements embedded using the [[data URI scheme]] are standard web pages, and can be opened by any modern browser, including browsers not supporting MHTML such as Mozilla Firefox.&amp;lt;ref&amp;gt;{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#browser_compatibility|title=Data URLs - HTTP|website=MDN|language=en|access-date=April 2, 2023}}&amp;lt;/ref&amp;gt; Unlike MHTML, saving web pages with their external resources embedded using data URIs requires a third-party extension to be installed in the browser.&amp;lt;ref&amp;gt;{{cite web|url=https://www.ghacks.net/2018/09/03/save-any-webpage-as-a-single-file-in-chrome-or-firefox/|title=Save any webpage as a single file in Chrome or Firefox - gHacks Tech News|last=Brinkmann|first=Martin|date=September 3, 2018|website=ghacks.net|language=en|access-date=April 2, 2023}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mozilla Archive Format ===&lt;br /&gt;
The [[Mozilla Archive Format]] (MAFF) is a legacy Web archive file format that was supported by Firefox from 2004 to 2018 through an add-on.&amp;lt;ref&amp;gt;{{cite web|url=https://www.amadzone.org/mozilla-archive-format/|title=Mozilla Archive Format Add-on - File Format Overview|website=amadzone|language=en|access-date=April 2, 2023}}&amp;lt;/ref&amp;gt; Unlike both MHTML and data URIs, MAFF uses a [[ZIP (file format)|ZIP]] container to preserve both the HTML file and its external elements. In October 2017 the add-on developer announced the format would no longer be supported in future versions of Firefox.&amp;lt;ref&amp;gt;{{cite web |url= https://addons.mozilla.org/en-US/firefox/addon/mozilla-archive-format/|title=Firefox Addon: MAF - Mozilla Archive Format|accessdate=2 April 2023 |url-status=dead |archive-url=https://web.archive.org/web/20171102005204/https://addons.mozilla.org/en-US/firefox/addon/mozilla-archive-format/ |archive-date=2 November 2017}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[data URI scheme]]&lt;br /&gt;
* [[Mozilla Archive Format]]&lt;br /&gt;
* [[Web Archive (file format)|Web Archive format]]&lt;br /&gt;
* [[WARC (file format)|WARC format]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://www.dsv.su.se/~jpalme/ietf/mhtml.html MHTML standard explained]&lt;br /&gt;
* [https://datatracker.ietf.org/doc/rfc2557/ RFC 2557] (1999)—MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)&lt;br /&gt;
* [https://datatracker.ietf.org/doc/rfc2110/ RFC 2110] (1997, Obsolete)—MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)&lt;br /&gt;
&lt;br /&gt;
{{web browsers}}&lt;br /&gt;
{{Internet Explorer}}&lt;br /&gt;
{{Microsoft Office}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Archive formats]]&lt;br /&gt;
[[Category:Internet Explorer]]&lt;br /&gt;
[[Category:HTML]]&lt;br /&gt;
[[Category:MIME]]&lt;br /&gt;
[[Category:Web archives]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Mrqwerty567</name></author>
	</entry>
</feed>