Security foundations Security boundaries 2 min read
What stops a web app from opening the rest of your files?
You open an online photo editor and select portrait.jpg in the browser’s file picker. A tax document sits in the same folder. Why can’t the editor open that too?
-
The browser hands over one file
The photo editor asks the browser to open a picker. You choose
portrait.jpg. The browser gives the page a file handle for that selection, which lets the editor access the photo within the permission it was granted.In short The grant is for the file you selected.
-
The browser enforces the boundary
The editor can ask for another file, but the browser controls the picker and the permission. That makes the browser the enforcer: it mediates what the web page can access on your device.
In short Find the component that can enforce the permission.
What happens after you grant access
Once the editor can read the photo, it can work with the photo’s contents. The file grant controls access to your device. It doesn’t decide what the editor does with the contents after reading them.
Keep this
Find who enforces the permission.
Follow the request to the component that can grant or refuse access.