Skip to content
Access control Advisory Intermediate CVE-2025-12905

Inappropriate implementation in Downloads (CVE-2025-12905)

A locally opened HTML file can cause Chrome to overwrite an existing downloaded executable, stripping its Mark of the Web. An attacker could then trick a user into running the executable without the usual security warning.

Tom Haas Follow

Originally disclosed on Chrome VRP

Bounty$2,000 Low View original
  • Fix shipped in 53 days

Report description

Bypassing Mark of the Web with an HTML File and User Interaction


Bug location

Where do you want to report your vulnerability?

Chrome VRP – Report security issues affecting the Chrome browser. See program rules


The problem

Please describe the technical details of the vulnerability

Vulnerability

A locally opened HTML file can be used to remove the Mark of the Web from any file accessible to the targeted user, including attacker-supplied executables.

How?

Depending on whether a download is initiated by user interaction or generated via a data-src URL, the file will have different HostUrl values and ZoneIds. Regardless of the ZoneID, the Mark of the Web can be fully removed simply by referencing the downloaded executable using its complete local path. This is only possible if the HTML file is opened locally via file:///.

PoC

By referencing the downloaded file with its full path, for example <iframe src="file:///C:/Users/<user>/Downloads/calc.exe">, the browser will attempt to download the file again if it is an executable or a non-displayable file (such as a ZIP archive), instead of rendering its contents.

Instead of creating a new copy, the browser appears to overwrite the existing file, incorrectly treating it as a trusted local file. As a result, the Mark of the Web is removed from the payload.

You can retrieve the username in Chrome (with default settings) by reading window.location.href and extracting it with match(/file:\/\/\/[a-zA-Z]:\/Users\/([^\/;]+)/i);.

Actual Bug that happens in background:

In Chrome, when downloading a file that already exists in the Downloads folder (referenced via its full path), the browser "overwrites" the original file instead of creating a copy. This overwriting removes the ADR (Alternate Data Stream) and, with it, the Mark of the Web.

Whether it really fully replaces the file with its full content or it just "strips" the ADR I am not sure of.

I believe, since the file is loaded via file:///C:... it is wrongly assumed as local origin. However, even if that were true, it should then, instead of omitting the ADR entirely, assign ZoneID 0.

More importantly, the ADR should be preserved: since the file originated from the internet and had MotW set, redownloading or referencing it locally should not strip the MotW.

Firefox Firefox does not overwrite the file, so the MotW is not removed. Therefore, this method does not work in Firefox.

Impact analysis – Please briefly explain who can exploit the vulnerability, and what they gain when doing so

What is the Impact?

Security Feature Bypass – Mark of the Web

This vulnerability enables attackers to distribute an HTML file containing an embedded executable payload. When a victim opens the HTML file and downloads the payload — either by clicking a link or through a delayed background download that avoids triggering the usual multiple-download permission popup — the payload can then be accessed and downloaded again using its full local file path. This second download strips the Mark of the Web (MotW) from the file. As a result, when the user is tricked into opening the file, no MotW is present and no security warning is displayed.

Exploiting this technique requires only basic technical skills.

For demonstration, two sample motw.html files are provided (one for ZoneId4 and one for ZoneId3, which triggers classic SmartScreen behavior), along with source code for a small executable, a template, and a PowerShell script to generate the motw.html file with the embedded executable (calc.c in ./src). The executable simply launches calc.exe. The two HTML scenarios showcase different approaches: one leads to ZoneID 4, and the other to ZoneID 3. These files do not need to be hosted online; Chrome will automatically apply the Mark of the Web to any file downloaded via a local HTML file.


The cause

Choose the type of vulnerability

Other

Does anyone else know about this vulnerability?

No, this vulnerability is private.

Do you plan to disclose this vulnerability publicly?

Yes, I plan to disclose

The original report as published on the Chromium issue tracker, by Tom Haas. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Chrome's Downloads feature applies the Mark of the Web (MotW) to files it downloads from the internet. On Windows, MotW is stored as an Alternate Data Stream (ADR) on the file, and it carries a ZoneID that tells the operating system and other applications where the file came from. A file with a higher ZoneID (for example ZoneID 4, the internet zone) is treated as untrusted, so opening an executable triggers warnings such as SmartScreen. Removing the ADR removes that protection.

The report describes a way to strip MotW from any file accessible to the targeted user, including attacker-supplied executables, using a locally opened HTML file. The researcher reported it through the Chrome Vulnerability Reward Program as an inappropriate implementation in Downloads. The platform records it as CVE-2025-12905, severity low, with a bounty of 2000.00 USD, disclosed on 2025-09-02.

Setup

The technique requires the victim to open an HTML file locally, that is, via a file:/// URL. The report does not name specific Chrome versions. The researcher notes that the username can be recovered in Chrome with default settings by reading window.location.href and extracting it with this regular expression:

JavaScript
match(/file:\/\/\/[a-zA-Z]:\/Users\/([^\/;]+)/i);

The demonstration material consists of two sample motw.html files, one producing ZoneID 4 and one producing ZoneID 3 (the latter triggers classic SmartScreen behaviour), plus source code for a small executable, a template, and a PowerShell script that generates the motw.html file with the embedded executable (calc.c in ./src). The executable simply launches calc.exe. The files do not need to be hosted online: Chrome applies MotW to any file downloaded through a local HTML file.

Finding it

The researcher observed that a download initiated by user interaction and a download generated via a data-src URL end up with different HostUrl values and ZoneIDs. Despite that difference, the MotW can be removed in both cases by referencing the downloaded executable through its complete local path, provided the HTML file itself was opened locally via file:///.

The core observation is that when the browser is asked to load a file that already exists in the Downloads folder, referenced by its full path, it does not create a new copy. It appears to overwrite the existing file and treats it as a trusted local file, which removes the ADR and with it the MotW.

Exploitation

Step 1: Deliver and open the HTML file

The attacker distributes an HTML file containing an embedded executable payload. The victim opens it locally, so the page runs from a file:/// origin. The report notes that the payload can be downloaded either by clicking a link or through a delayed background download that avoids triggering the usual multiple-download permission popup.

Step 2: Reference the downloaded file by its full local path

The HTML page references the downloaded executable using its complete path, for example:

HTML
<iframe src="file:///C:/Users/<user>/Downloads/calc.exe">

When the browser is pointed at an executable or a non-displayable file (such as a ZIP archive) this way, it does not render the contents. Instead it attempts to download the file again. Because the file already exists at that path, the browser overwrites the original rather than creating a copy, and in doing so removes the ADR that held the MotW.

Step 3: Open the payload without a warning

With the MotW gone, the user can be tricked into opening the file and no security warning is displayed. The report states that exploiting the technique requires only basic technical skills.

Root cause

The researcher's explanation is that, because the file is loaded via file:///C:..., the browser wrongly assumes it is of local origin. Even if that assumption were accepted, the report argues the browser should assign ZoneID 0 rather than omitting the ADR entirely. More importantly, the ADR should be preserved: a file that originated from the internet and had MotW set should not lose it when it is redownloaded or referenced locally.

The researcher says he is not sure whether the browser fully replaces the file with its full content or merely strips the ADR. Either way, the overwrite path is what removes the protection.

Firefox does not overwrite the file in this situation, so the MotW is not removed and the method does not work there.

Impact

The vulnerability is a security feature bypass of the Mark of the Web. An attacker can distribute an HTML file with an embedded executable payload; once the victim opens the HTML file and the payload is downloaded, a second access through the full local path strips MotW. When the user is then tricked into opening the file, no MotW is present and no security warning is shown. The report frames the required skill as basic.

Fix

Its stated expectation is that the ADR should be preserved for files that originated from the internet, and that a file loaded via file:///C:... should at most receive ZoneID 0 rather than having the ADR omitted.

  • Repeat the full-path reference against other non-displayable file types, such as archives, and check whether the ADR is stripped in the same way. A positive result is a file that no longer carries its ZoneID after the second download.
  • Compare the user-interaction download path with the data-src URL path, since the report says they produce different HostUrl values and ZoneIDs. A positive result is MotW removal in both cases.
  • Try the same technique in other browsers. Firefox is reported not to overwrite the file, so a positive result elsewhere would be a browser that overwrites the existing file and drops the ADR.
  • Test whether the delayed background download avoids the multiple-download permission popup as described, and whether the payload still receives MotW before the second reference.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

When you download a file from the internet on Windows, the operating system quietly attaches a small label to it. That label is called the Mark of the Web, or MotW for short. It is like a sticker on a parcel that says "this came from outside, be careful". When you later try to run a program that carries this sticker, Windows shows a warning, for example the blue SmartScreen screen that asks whether you really want to run it.

The researcher found a way to peel that sticker off. The trick uses an HTML file (a web page saved as a file on your computer) that you open directly from your own disk. That page can make Chrome download a program, and then make Chrome look at that same program again using its full location on disk. The second look appears to cause Chrome to overwrite the file, and the overwrite removes the label. After that, the program runs without the usual warning.

The report was sent to Google's Chrome Vulnerability Reward Program, which pays people for finding security problems in the Chrome browser. The platform records it as CVE-2025-12905, rated low severity, with a bounty of 2000.00 USD, disclosed on 2025-09-02. A CVE is a public catalogue number given to a known security flaw so people can refer to it unambiguously.

The pieces you need to understand first

Before the details make sense, here are a few ideas explained from zero.

  • The Mark of the Web (MotW). On Windows, files downloaded from the internet get a hidden marker. Windows and programs like browsers and antivirus tools read this marker to decide how much to trust the file. A file without the marker is treated as if it were made on your own machine, so it gets fewer warnings.
  • Alternate Data Stream (ADR). Windows files can carry extra hidden data attached to them, separate from the visible contents. Think of a paper document with a sticky note on the back: the note is not part of the text, but it travels with the document. The MotW is stored in such a hidden attachment. Remove the attachment and the marker is gone.
  • ZoneID. The marker includes a number that says where the file came from. A higher number means less trusted. ZoneID 4 is the internet zone, the least trusted. ZoneID 3 is a slightly less strict zone. ZoneID 0 would mean the local machine, the most trusted. The report mentions all three.
  • SmartScreen. A Windows feature that checks programs before they run and shows a warning if the program looks unfamiliar or came from the internet. It relies on the MotW to know a file came from outside.
  • file:/// URL. When you open a file directly from your own disk in a browser, the address bar shows something starting with file:/// instead of https://. Pages loaded this way run from your local machine, not from a website.
  • HTML file. A plain text file that a browser can display as a web page. It can contain links, frames and small scripts.
  • iframe. A way to embed one page or file inside another page, like a picture frame inside a larger picture. The browser loads whatever address the frame points to.
  • Regular expression. A short pattern used to search text. It describes what to look for, for example "a drive letter, then the word Users, then a name".
  • PowerShell. A scripting tool built into Windows that can automate tasks such as generating files.
  • Security feature bypass. A class of vulnerability where an attacker does not break a lock directly but finds a way around a protection that is supposed to keep them out. Here the protection is the MotW warning, and the bypass is removing the marker so the warning never appears.

The setup the researcher used

The technique only works if the victim opens an HTML file locally, that is, through a file:/// address. The report does not name specific Chrome versions.

The researcher notes that, with Chrome's default settings, the page can learn the victim's Windows username by reading window.location.href (the full address of the current page) and pulling the name out with this pattern:

JavaScript
match(/file:\/\/\/[a-zA-Z]:\/Users\/([^\/;]+)/i);

Line by line:

  • match(...) is a function that searches a piece of text for a pattern and returns what it finds.
  • /.../i marks the start and end of a regular expression; the i at the end means the search ignores upper and lower case.
  • file:\/\/\/ looks for the literal text file:///. The backslashes are needed because / normally ends the pattern, so each slash is escaped.
  • [a-zA-Z] matches a single letter, which stands for the drive letter such as C.
  • : matches the colon after the drive letter.
  • \/Users\/ matches the text /Users/, the folder Windows keeps user profiles in.
  • ([^\/;]+) is a capture group: it collects one or more characters that are not a slash and not a semicolon. That collected piece is the username.

Why does this matter? Because the attacker needs to know the exact path of the downloaded file to point the browser at it later, and the username is part of that path.

The demonstration material, as described in the report, consists of:

  1. Two sample motw.html files, one producing ZoneID 4 and one producing ZoneID 3. The ZoneID 3 sample triggers the classic SmartScreen behaviour.
  2. Source code for a small executable.
  3. A template.
  4. A PowerShell script that generates the motw.html file with the embedded executable (calc.c in ./src).

The executable simply launches calc.exe. The files do not need to be hosted online: Chrome applies the MotW to any file downloaded through a local HTML file.

How the researcher found it

The researcher compared two ways a download can start. One is a download the user starts by clicking something. The other is a download generated automatically through a data-src URL, which is an address embedded in the page that the browser fetches on its own. These two paths end up with different HostUrl values (the address the browser records as the source of the download) and different ZoneIDs.

Despite that difference, the researcher found that the MotW can be removed in both cases, as long as the downloaded executable is referenced through its complete local path and the HTML file itself was opened locally via file:///.

The key observation: when the browser is asked to load a file that already exists in the Downloads folder, referenced by its full path, it does not make a new copy. It appears to overwrite the existing file and treat it as a trusted local file. That overwrite removes the hidden attachment, and with it the MotW.

Exploitation, step by step

Step 1: Deliver and open the HTML file

The attacker sends the victim an HTML file that contains an embedded executable payload. The victim opens it from their own disk, so the page runs from a file:/// origin. The report notes that the payload can be downloaded either by clicking a link or through a delayed background download that avoids triggering the usual multiple-download permission popup. That popup is Chrome's way of asking whether you really want to allow a site to download several files; a delayed background download slips past it.

Why this step matters: the whole trick depends on the page running from the local disk, because only then can it point the browser at other local files.

Step 2: Reference the downloaded file by its full local path

The page then points the browser at the downloaded executable using its complete path, for example:

HTML
<iframe src="file:///C:/Users/<user>/Downloads/calc.exe">

Line by line:

  • <iframe ...> creates an embedded frame inside the page.
  • src= tells the frame which address to load.
  • "file:///C:/Users/<user>/Downloads/calc.exe" is the full local path of the downloaded program. <user> stands for the victim's Windows username, which the page obtained earlier.

When the browser is pointed at an executable or a non-displayable file (such as a ZIP archive) this way, it does not show the contents. Instead it tries to download the file again. Because the file already exists at that path, the browser overwrites the original rather than creating a copy, and in doing so removes the hidden attachment that held the MotW.

Why this step matters: this is the moment the protection is stripped. The browser thinks it is dealing with a local file, so it does not preserve the "came from the internet" marker.

Step 3: Open the payload without a warning

With the MotW gone, the user can be tricked into opening the file and no security warning is displayed. The report states that exploiting the technique requires only basic technical skills.

Why this step matters: the entire goal of the attack is to reach this point, where the usual SmartScreen warning is missing and the program runs quietly.

Why it works (root cause)

The researcher's explanation is that, because the file is loaded via file:///C:..., the browser wrongly assumes it is of local origin. Even if that assumption were accepted, the report argues the browser should assign ZoneID 0 rather than omitting the hidden attachment entirely. More importantly, the attachment should be preserved: a file that originated from the internet and had MotW set should not lose it when it is redownloaded or referenced locally.

The researcher says he is not sure whether the browser fully replaces the file with its full content or merely strips the hidden attachment. Either way, the overwrite is what removes the protection.

Firefox does not overwrite the file in this situation, so the MotW is not removed and the method does not work there.

Impact

The vulnerability is a security feature bypass of the Mark of the Web. An attacker can distribute an HTML file with an embedded executable payload. Once the victim opens the HTML file and the payload is downloaded, a second access through the full local path strips the MotW. When the user is then tricked into opening the file, no MotW is present and no security warning is shown. The report frames the required skill as basic.

Fix

Its stated expectation is that the hidden attachment should be preserved for files that originated from the internet, and that a file loaded via file:///C:... should at most receive ZoneID 0 rather than having the attachment omitted.

  • Repeat the full-path reference against other non-displayable file types, such as archives, and check whether the hidden attachment is stripped in the same way. A positive result is a file that no longer carries its ZoneID after the second download.
  • Compare the user-interaction download path with the data-src URL path, since the report says they produce different HostUrl values and ZoneIDs. A positive result is MotW removal in both cases.
  • Try the same technique in other browsers. Firefox is reported not to overwrite the file, so a positive result elsewhere would be a browser that overwrites the existing file and drops the hidden attachment.
  • Test whether the delayed background download avoids the multiple-download permission popup as described, and whether the payload still receives MotW before the second reference.

Glossary

  • Mark of the Web (MotW): a hidden marker Windows attaches to files downloaded from the internet, used to decide how much to trust them.
  • Alternate Data Stream (ADR): extra hidden data attached to a file on Windows, separate from its visible contents; the MotW is stored this way.
  • ZoneID: a number inside the MotW saying where a file came from; higher means less trusted (4 is the internet, 0 is the local machine).
  • SmartScreen: a Windows feature that warns before running unfamiliar or internet-originated programs.
  • file:/// URL: an address that points to a file on your own disk rather than to a website.
  • HTML file: a text file a browser can display as a web page.
  • iframe: an element that embeds one page or file inside another.
  • Regular expression: a short pattern used to search text for a particular shape.
  • window.location.href: the full address of the page currently open in the browser.
  • PowerShell: a scripting tool built into Windows for automating tasks.
  • Executable: a program file that can be run, such as .exe on Windows.
  • Payload: the harmful or demonstration program an attacker wants the victim to run.
  • Security feature bypass: a vulnerability where a protection is circumvented rather than broken directly.
  • CVE: a public catalogue number for a known security flaw.
  • Chrome Vulnerability Reward Program (VRP): Google's programme that pays researchers for reporting security issues in Chrome.
  • Bounty: the money paid to a researcher for a valid report.
  • HostUrl: the address the browser records as the source of a download.
  • data-src URL: an address embedded in a page that the browser fetches automatically.
  • ZoneID 4 / ZoneID 3 / ZoneID 0: the internet zone, a slightly less strict zone, and the local machine zone respectively.
  • Severity: a rating of how serious a vulnerability is; this one is rated low.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.