Skip to content
Path traversal Advisory Advanced CVE-2026-13791

Insufficient validation of untrusted input in Downloads (CVE-2026-13791)

Chrome's downloads API only checked that an extension-supplied filename was lexically safe, so a path whose intermediate folder was an existing symlink or junction inside Downloads was accepted and written through. An extension with the downloads permission could therefore write attacker-controlled files outside the Downloads folder and, in the proof of concept, overwrite an executable to achieve code execution on macOS.

Ron Masas Follow

Originally disclosed on Chrome VRP

Bounty$10,000 High View original
  • Fix shipped in 2 months

Report description

chrome.downloads symlink/junction escape under Downloads can lead to RCE


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

Summary

An extension can escape the intended Downloads root by supplying a lexically safe relative filename whose intermediate component is an existing symlink (POSIX) or junction/reparse-point directory (Windows) inside the Downloads directory. Chrome accepts the path as syntactically safe and then writes through the linked directory without enforcing resolved-path containment. Combined with downloads.open, this can be turned into remote code execution, as shown in the attached PoC and video: https://drive.google.com/file/d/1rQFgd76v7Djt-_UteD2rRi0UzaXKfjj7/view?usp=sharing

Root Cause

  • chrome.downloads.download() only validates the extension-supplied filename as a lexically safe relative path in chrome/browser/extensions/api/downloads/downloads_api.cc:1163-1170.
  • downloads.onDeterminingFilename suggestions are validated the same way in chrome/browser/extensions/api/downloads/downloads_api.cc:2001-2015.
  • That validation relies on net::IsSafePortableRelativePath() in net/base/filename_util_icu.cc:34-44, which rejects absolute paths and traversal tokens but does not resolve symlinks/junctions.
  • Chrome then roots the path with a plain append in chrome/browser/download/download_target_determiner.cc:486-487.
  • The reservation layer explicitly documents that it does not look at symlinks or mount points in components/download/public/common/download_path_reservation_tracker.h:107-109, and it uses ordinary writability / directory creation checks in components/download/internal/common/download_path_reservation_tracker.cc:219-225 and :357-361.

Prerequisites

  • macOS.
  • A macOS configuration where the logged-in user account running Chrome can overwrite files under /Applications/Google Chrome.app. In my testing, this was possible on a default non-enterprise device; managed or locked-down systems may differ.

Steps to Reproduce

  1. Download the attached extension files (manifest.json, service-worker.js, open.html, open.js, and zip_builder.js) and place them together in a local directory named install-download-open.
  2. Open chrome://extensions, enable Developer mode, click Load unpacked, and select that install-download-open directory.
  3. When open.html opens, click the button.
  4. Wait a few seconds for the sequence to complete.

Expected Result

  • Calculator opens.

Impact analysis

A malicious browser extension that has the downloads permission can exploit this issue. For the full chain shown in the PoC, the extension also uses downloads.open. In practice, that means an attacker would need to get a user to install a malicious extension, or compromise an existing extension that already has those permissions. This is not a normal website-only bug.

What the attacker gains is the ability to make Chrome write attacker-controlled files outside the intended Downloads directory by targeting a preexisting symlink or junction under Downloads. That expands the extension’s write primitive beyond the Downloads sandbox. In the PoC, that primitive is strong enough to overwrite an executable target and trigger code execution on macOS.


The cause

What version of Chrome have you found the security issue in?

147.0.7727.56 (Official Build) (arm64)

Is the security issue related to a crash?

No, it is not related to a crash.

Choose the type of vulnerability

Remote Code Execution (RCE)

How would you like to be publicly acknowledged for your report?

Ron Masas

The original report as published on the Chromium issue tracker, by Ron Masas (Imperva). 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. 5 min read.

Context

Chrome extensions that hold the downloads permission can ask the browser to save a file, and they can supply the filename that should be used. Chrome is supposed to keep those writes inside the user's Downloads directory: the extension names a relative path, and the browser roots it under Downloads. The downloads.onDeterminingFilename event lets an extension suggest a filename in the same way.

The report describes a way to escape that root. An extension supplies a relative filename that is lexically safe, but one of its intermediate components is an existing symlink on POSIX or a junction or reparse-point directory on Windows inside the Downloads directory. Chrome accepts the path as syntactically safe and writes through the linked directory without checking that the resolved path is still contained. Combined with downloads.open, the write primitive can be turned into remote code execution. The issue was tracked as CVE-2026-13791, rated high severity, and disclosed on 30 June 2026. The researcher is Ron Masas of Imperva, and the Chrome VRP paid a bounty of 10,000 USD.

Setup

The proof of concept targets macOS. The prerequisite is a macOS configuration where the logged-in user account running Chrome can overwrite files under /Applications/Google Chrome.app. In the researcher's testing this was possible on a default non-enterprise device; managed or locked-down systems may differ.

The extension used in the PoC needs the downloads permission, and for the full chain it also uses downloads.open. The extension files are manifest.json, service-worker.js, open.html, open.js and zip_builder.js. The issue was found in Chrome 147.0.7727.56 (Official Build) (arm64). It is not related to a crash.

Finding it

The researcher looked at how chrome.downloads.download() validates the filename supplied by an extension. The check is lexical: it treats the value as a relative path and rejects absolute paths and traversal tokens, but it never resolves symlinks or junctions. The same validation is applied to suggestions from downloads.onDeterminingFilename. After validation, Chrome roots the path with a plain append under the Downloads directory. The reservation layer that later creates and reserves the file explicitly documents that it does not look at symlinks or mount points, and it relies on ordinary writability and directory creation checks.

That combination means a path can be safe as a string and still point outside Downloads once the filesystem resolves it. If an intermediate directory inside Downloads is a symlink (POSIX) or a junction or reparse point (Windows), the write follows the link.

Exploitation

Step 1: prepare the extension

Download the attached extension files (manifest.json, service-worker.js, open.html, open.js and zip_builder.js) and place them together in a local directory named install-download-open.

Step 2: load the extension

Open chrome://extensions, enable Developer mode, click Load unpacked, and select the install-download-open directory.

Step 3: trigger the chain

When open.html opens, click the button. When open.html opens, click the button and wait a few seconds for the sequence to complete.

Step 4: wait for completion

Wait a few seconds for the sequence to complete. The expected result is that Calculator opens, which demonstrates code execution on the host.

The report also links a PoC and video at https://drive.google.com/file/d/1rQFgd76v7Djt-_UteD2rRi0UzaXKfjj7/view?usp=sharing. The extension source files themselves are not reproduced in the report text.

Root cause

The validation happens in two places:

  • chrome.downloads.download() validates the extension-supplied filename as a lexically safe relative path in chrome/browser/extensions/api/downloads/downloads_api.cc:1163-1170.
  • downloads.onDeterminingFilename suggestions are validated the same way in chrome/browser/extensions/api/downloads/downloads_api.cc:2001-2015.

That validation relies on net::IsSafePortableRelativePath() in net/base/filename_util_icu.cc:34-44, which rejects absolute paths and traversal tokens but does not resolve symlinks or junctions. Chrome then roots the path with a plain append in chrome/browser/download/download_target_determiner.cc:486-487.

The reservation layer explicitly documents that it does not look at symlinks or mount points in components/download/public/common/download_path_reservation_tracker.h:107-109, and it uses ordinary writability and directory creation checks in components/download/internal/common/download_path_reservation_tracker.cc:219-225 and :357-361.

In short, the validation is lexical, and the resolved path is not checked for containment, so a pre-existing link inside Downloads redirects the write.

Impact

A malicious browser extension with the downloads permission can exploit this. For the full chain shown in the PoC, the extension also uses downloads.open. In practice an attacker would need to get a user to install a malicious extension, or compromise an existing extension that already has those permissions. This is not a normal website-only bug.

The attacker gains the ability to make Chrome write attacker-controlled files outside the intended Downloads directory by targeting a pre-existing symlink or junction under Downloads. That expands the extension's write primitive beyond the Downloads sandbox. In the PoC the primitive is strong enough to overwrite an executable target and trigger code execution on macOS. The macOS prerequisite is that the user running Chrome can overwrite files under /Applications/Google Chrome.app; managed or locked-down systems may differ.

Fix

The report does not describe a fix. The report does not describe a fix.

Variants to test

  1. Other intermediate link types. Try a relative filename whose intermediate component is a symlink, a junction, or a reparse point inside the download root. A positive result is a file written outside the root.
  2. Both entry points. Test the same filename through chrome.downloads.download() and through a downloads.onDeterminingFilename suggestion. A positive result is the same escape through either path.
  3. Other platforms. The report's PoC is macOS-only, but the root cause covers POSIX symlinks and Windows junctions. A positive result on another platform is a write outside Downloads through a pre-existing link.
  4. Chained launch. Combine the escape with downloads.open to launch the written file. A positive result is code execution, as in the PoC where Calculator opens.

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. 11 min read.

What happened, in plain words

Chrome lets browser extensions save files for you. An extension is a small add-on program you install into the browser, and some extensions are allowed to ask Chrome to download files. When an extension does that, it can also suggest the name and folder for the file. Chrome is supposed to keep all of those files inside your Downloads folder, so an extension cannot scatter files all over your computer.

This report shows that the protection can be bypassed. The trick is to give Chrome a file path that looks harmless when you read it as text, but that actually points somewhere else once the computer follows the links inside it. On macOS and Linux those links are called symlinks; on Windows they are called junctions or reparse points. Chrome checks the text of the path but never checks where the path really ends up, so it happily writes the file outside Downloads. Combined with another extension feature that opens downloaded files, this can be turned into running attacker code on the machine, which is called remote code execution (RCE).

The issue was tracked as CVE-2026-13791, rated high severity, and disclosed on 30 June 2026. The researcher is Ron Masas of Imperva, and the Chrome VRP (the Chrome Vulnerability Reward Program, Google's bug bounty scheme for Chrome) paid a bounty of 10,000 USD.

The pieces you need to know

Before the details, a few everyday ideas:

  • Extension: a small program added to Chrome, like an app on a phone. Extensions ask for permissions, which are declared abilities such as "may download files".
  • Permission: an explicit grant. The downloads permission lets an extension ask Chrome to save files. The downloads.open permission lets it ask Chrome to open a downloaded file with its default program.
  • API: an Application Programming Interface, a set of commands one program can call on another. Here chrome.downloads.download() is the command an extension calls to start a download.
  • Relative path: a file location written relative to a starting folder, for example sub/file.txt means "inside the current folder, go into sub, then take file.txt". An absolute path starts from the root of the disk, like /Users/me/file.txt.
  • Symlink (symbolic link): a shortcut file that points at another location. Opening the shortcut is like following a signpost: you end up wherever it points. On Windows the equivalent ideas are a junction and a reparse point, which are directory links managed by the filesystem.
  • Lexical check: a check done on the text of a path only, without asking the operating system where that path really leads. It is like reading a forwarding address on an envelope without checking whether the destination house exists.
  • Resolved path: the real location you reach after following every link in a path.
  • Containment: the rule that the final, resolved location must still sit inside the allowed folder (here, Downloads).
  • Write primitive: a basic ability an attacker has gained, such as "can make the browser write a file to a chosen place". Bigger attacks are built by chaining small primitives.
  • RCE (remote code execution): making a victim's computer run code the attacker chose. It is the most serious class of impact, because the attacker's program then runs with the user's rights.
  • PoC (proof of concept): a small demonstration that proves a vulnerability is real.
  • CVE: a public identifier for a known vulnerability, so people can refer to it unambiguously.

Context: what Chrome promises

Chrome extensions that hold the downloads permission can ask the browser to save a file, and they can supply the filename that should be used. Chrome is supposed to keep those writes inside the user's Downloads directory: the extension names a relative path, and the browser roots it under Downloads. The downloads.onDeterminingFilename event lets an extension suggest a filename in the same way. An event here is a notification Chrome sends to the extension at a certain moment; this one fires while Chrome is deciding what to call the file, giving the extension a chance to suggest a name.

The report describes a way to escape that root. An extension supplies a relative filename that is lexically safe, but one of its intermediate components is an existing symlink on POSIX or a junction or reparse-point directory on Windows inside the Downloads directory. POSIX is the family of operating systems that includes macOS and Linux. An intermediate component is any folder in the middle of the path, not the file itself: in a/b/file.txt, both a and b are intermediate components.

Chrome accepts the path as syntactically safe and writes through the linked directory without checking that the resolved path is still contained. Combined with downloads.open, the write primitive can be turned into remote code execution.

Setup: what the demonstration needs

The proof of concept targets macOS. The prerequisite is a macOS configuration where the logged-in user account running Chrome can overwrite files under /Applications/Google Chrome.app. That folder is where the Chrome application itself lives, so being able to overwrite files there means being able to change the browser's own program files. In the researcher's testing this was possible on a default non-enterprise device; managed or locked-down systems may differ.

The extension used in the PoC needs the downloads permission, and for the full chain it also uses downloads.open. The extension files are manifest.json, service-worker.js, open.html, open.js and zip_builder.js. The issue was found in Chrome 147.0.7727.56 (Official Build) (arm64). It is not related to a crash, meaning the bug does not make the browser fall over; it silently does the wrong thing.

Finding it: why the check fails

The researcher looked at how chrome.downloads.download() validates the filename supplied by an extension. The check is lexical: it treats the value as a relative path and rejects absolute paths and traversal tokens, but it never resolves symlinks or junctions. A traversal token is the .. sequence, which means "go up one folder"; rejecting it stops the simplest way of climbing out of Downloads. The same validation is applied to suggestions from downloads.onDeterminingFilename.

After validation, Chrome roots the path with a plain append under the Downloads directory. "Plain append" means it simply glues the Downloads folder and the extension's path together as text, without asking the filesystem what that combined path really points to. The reservation layer that later creates and reserves the file explicitly documents that it does not look at symlinks or mount points, and it relies on ordinary writability and directory creation checks. The reservation layer is the part of Chrome that picks the final file location and makes sure the name is free before writing.

That combination means a path can be safe as a string and still point outside Downloads once the filesystem resolves it. If an intermediate directory inside Downloads is a symlink (POSIX) or a junction or reparse point (Windows), the write follows the link. Think of a hotel that checks your room number is written correctly on the key card, but never checks that the door with that number is actually inside the hotel.

Exploitation: the four steps

Step 1: prepare the extension

Download the attached extension files (manifest.json, service-worker.js, open.html, open.js and zip_builder.js) and place them together in a local directory named install-download-open.

Why: an unpacked extension is just a folder of files, which Chrome loads directly from disk. zip_builder.js is one of the files the researcher shipped; the report does not describe what each file contains.

Step 2: load the extension

Open chrome://extensions, enable Developer mode, click Load unpacked, and select the install-download-open directory.

Why: chrome://extensions is Chrome's built-in extension manager. Developer mode reveals the Load unpacked button, which installs an extension straight from a folder on disk instead of from the Chrome Web Store. This is how a researcher tests an extension without publishing it.

Step 3: trigger the chain

When open.html opens, click the button. When open.html opens, click the button and wait a few seconds for the sequence to complete.

Why: the button starts the demonstration; the report says to click it and wait a few seconds.

Step 4: wait for completion

Wait a few seconds for the sequence to complete. The expected result is that Calculator opens, which demonstrates code execution on the host. The host is the actual computer, as opposed to the sandboxed world of the browser tab.

The report also links a PoC and video at https://drive.google.com/file/d/1rQFgd76v7Djt-_UteD2rRi0UzaXKfjj7/view?usp=sharing. The extension source files themselves are not reproduced in the report text.

Root cause: the exact lines

The validation happens in two places:

  • chrome.downloads.download() validates the extension-supplied filename as a lexically safe relative path in chrome/browser/extensions/api/downloads/downloads_api.cc:1163-1170.
  • downloads.onDeterminingFilename suggestions are validated the same way in chrome/browser/extensions/api/downloads/downloads_api.cc:2001-2015.

Those references are file names and line numbers inside Chrome's own source code, so anyone can look up the exact check. The .cc extension marks a C++ source file.

That validation relies on net::IsSafePortableRelativePath() in net/base/filename_util_icu.cc:34-44, which rejects absolute paths and traversal tokens but does not resolve symlinks or junctions. Chrome then roots the path with a plain append in chrome/browser/download/download_target_determiner.cc:486-487.

The reservation layer explicitly documents that it does not look at symlinks or mount points in components/download/public/common/download_path_reservation_tracker.h:107-109, and it uses ordinary writability and directory creation checks in components/download/internal/common/download_path_reservation_tracker.cc:219-225 and :357-361.

In short, the validation is lexical, and the resolved path is not checked for containment, so a pre-existing link inside Downloads redirects the write. "Preexisting" matters: the attacker does not need to create the link, only to find one that is already there.

Impact: who can do this and what they get

A malicious browser extension with the downloads permission can exploit this. For the full chain shown in the PoC, the extension also uses downloads.open. In practice an attacker would need to get a user to install a malicious extension, or compromise an existing extension that already has those permissions. This is not a normal website-only bug, so simply visiting a web page is not enough.

The attacker gains the ability to make Chrome write attacker-controlled files outside the intended Downloads directory by targeting a pre-existing symlink or junction under Downloads. That expands the extension's write primitive beyond the Downloads sandbox. The sandbox here is the rule that confines an extension's file writes to one folder. In the PoC the primitive is strong enough to overwrite an executable target and trigger code execution on macOS. The macOS prerequisite is that the user running Chrome can overwrite files under /Applications/Google Chrome.app; managed or locked-down systems may differ.

Fix

The report does not describe a fix. In the hotel comparison, that means walking to the room and confirming it is inside the building before handing over the key.

Variants to test

These are follow-up experiments a researcher would try to see how wide the problem is:

  1. Other intermediate link types. Try a relative filename whose intermediate component is a symlink, a junction, or a reparse point inside the download root. A positive result is a file written outside the root.
  2. Both entry points. Test the same filename through chrome.downloads.download() and through a downloads.onDeterminingFilename suggestion. A positive result is the same escape through either path.
  3. Other platforms. The report's PoC is macOS-only, but the root cause covers POSIX symlinks and Windows junctions. A positive result on another platform is a write outside Downloads through a pre-existing link.
  4. Chained launch. Combine the escape with downloads.open to launch the written file. A positive result is code execution, as in the PoC where Calculator opens.

Glossary

  • API: Application Programming Interface, a set of commands one program can call on another.
  • Absolute path: a file location written from the root of the disk, such as /Users/me/file.txt.
  • Bounty: a cash reward paid by a bug bounty program for a valid vulnerability report.
  • Chrome VRP: the Chrome Vulnerability Reward Program, Google's bug bounty scheme for Chrome.
  • Containment: the rule that a resolved path must still sit inside the allowed folder.
  • CVE: a public identifier for a known vulnerability.
  • Extension: a small add-on program installed into the browser.
  • Host: the actual computer, as opposed to the browser's sandboxed environment.
  • Intermediate component: any folder in the middle of a path, not the final file name.
  • Junction: a Windows directory link that points at another location on the filesystem.
  • Lexical check: a check performed on the text of a path only, without resolving where it really leads.
  • Manifest: the manifest.json file that describes an extension's name, files and permissions.
  • Permission: an explicit ability granted to an extension, such as downloads or downloads.open.
  • Plain append: gluing two path strings together as text without resolving the result.
  • PoC: proof of concept, a small demonstration that a vulnerability is real.
  • POSIX: the family of operating systems that includes macOS and Linux.
  • RCE: remote code execution, making a victim's computer run attacker-chosen code.
  • Relative path: a file location written relative to a starting folder.
  • Reparse point: a Windows filesystem feature that redirects access to another location.
  • Reservation layer: the part of Chrome that picks the final file location and reserves the name before writing.
  • Resolved path: the real location reached after following every link in a path.
  • Sandbox: a restriction that confines what a program is allowed to touch.
  • Service worker: a background script in an extension that runs without a visible page.
  • Symlink: a shortcut file that points at another location.
  • Traversal token: the .. sequence in a path, meaning "go up one folder".
  • Write primitive: a basic attacker ability, such as making the browser write a file to a chosen place.

More by Ron Masas

View all

1 more disclosed report, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.