Context menu commands—such as "Open Link in New Tab"—are a common way for users to initiate network requests (including navigation and downloads) using the URL of a selected HTML element.
For a document with a connection allowlist enforced, should this enforcement apply to network requests initiated via context menu commands?
Consider a page containing an LLM-generated anchor element:
- The URL of the anchor element's
href attribute can be arbitrary, presenting a data exfiltration risk.
- An event listener like
oncontextmenu can alter the href URL the moment the user opens the context menu.
Two options:
- Enforce the allowlist for network requests initiated via context menu commands:
- Mitigates exfiltration risks described above.
- Requires more complex implementation.
- May disrupt user expectations or perceived functionality.
- Treat these network requests as browser-initiated (out of scope for the connection allowlist):
- In Chromium, a navigation request triggered by "Open Link in New Tab" sets
initiator_frame to null and browser_initiated to true. This indicates the navigation is treated similarly to a user typing a URL into the Omnibox and pressing Enter, which is out of the scope of the connection allowlist.
- Leaves exfiltration risk unaddressed.
Context menu commands—such as "Open Link in New Tab"—are a common way for users to initiate network requests (including navigation and downloads) using the URL of a selected HTML element.
For a document with a connection allowlist enforced, should this enforcement apply to network requests initiated via context menu commands?
Consider a page containing an LLM-generated anchor element:
hrefattribute can be arbitrary, presenting a data exfiltration risk.oncontextmenucan alter thehrefURL the moment the user opens the context menu.Two options:
initiator_frameto null andbrowser_initiatedto true. This indicates the navigation is treated similarly to a user typing a URL into the Omnibox and pressing Enter, which is out of the scope of the connection allowlist.