Inappropriate implementation in iOSWeb (CVE-2026-13907)
The iOS context menu hit-testing logic calculates iframe coordinates using offsetLeft and offsetTop, which are relative to the offsetParent rather than the document. An attacker can manipulate DOM positioning to shift the hit-test location inside a cross-origin iframe, potentially tricking a user into copying a sensitive cross-origin link.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.
Overview: The iOS context menu hit-testing logic incorrectly calculates coordinates for iframes using offsetLeft and offsetTop, which are relative to the offsetParent rather than the document. An attacker can manipulate DOM positioning to arbitrarily shift the hit-test location inside a cross-origin iframe. Combined with a bypassed opacity check, this enables UI redressing where users are tricked into leaking sensitive cross-origin links.
Affected files:
ios/web/js_features/context_menu/resources/all_frames_context_menu.ts
Estimated timestamp from git blame: 2023-04-20
Description
When a user long-presses on a web page in Chromium for iOS, the browser determines the target element for the context menu. If the selected element is an iframe, the browser delegates the hit-test to that iframe by sending a coordinate payload via postMessage.
A vulnerability exists in the coordinate conversion logic within ios/web/js_features/context_menu/resources/all_frames_context_menu.ts. The function processElementForFindElementAtPoint calculates the coordinates to send to the iframe:
const payload = {
type: 'org.chromium.contextMenuMessage',
requestId: requestId,
x: centerX - element.offsetLeft,
y: centerY - element.offsetTop,
};
centerX and centerY are absolute page coordinates. However, element.offsetLeft and element.offsetTop are relative to the element's offsetParent (the nearest positioned ancestor), not the absolute page root.
By nesting an iframe within a positioned container (e.g., a div with position: relative), an attacker can cause element.offsetLeft to return a value relative to that container rather than the document root. This results in incorrect, attacker-controlled coordinates being passed to the iframe for hit-testing.
Impact
This vulnerability potentially enables a UI redressing (Clickjacking) attack. An attacker can strategically position a decoy element and manipulate the DOM hierarchy such that a long-press on the decoy triggers a context menu hit-test on a different, sensitive element inside a cross-origin iframe.
If the user interacts with the resulting context menu (for example, by choosing "Copy Link"), they may inadvertently disclose sensitive cross-origin data (like password reset URLs or tokens) to their clipboard.
Potential Steps to Reproduce
Note: These are suggested theoretical steps based on static analysis, as our tooling agent cannot execute live code.
- Attacker Setup: The attacker embeds a cross-origin iframe pointing to a sensitive resource on
victim.com. - DOM Manipulation: The attacker wraps the iframe in a container element with
position: absoluteat an arbitrary location (e.g.,left: 500px,top: 500px). This makes the container theoffsetParent. - Coordinate Shifting: The attacker applies CSS to the iframe:
position: absolute; left: -500px; top: -500px;. Visually, the iframe appears at(0,0), but itsoffsetLeftandoffsetTopare-500. - Decoy Overlay: The attacker overlays a decoy image exactly at
(0,0). To bypass theisOpaqueElementcheck (which uses anOPACITY_THRESHOLDof0.9), the decoy's opacity is set to0.89. - User Interaction: The user is tricked into long-pressing the decoy at
(0,0). - Hit-Test Failure: The script's hit-test evaluates the decoy, considers it transparent due to the
0.89opacity, and falls through to the iframe beneath it. - Corrupted Payload:
processElementForFindElementAtPointcalculates the coordinates for the iframe:x = 0 - (-500) = 500. It sends{x: 500, y: 500}to the cross-origin iframe. - Data Leak: The context menu is generated for the sensitive element at
(500, 500)inside the victim iframe, rather than the user's touch point. The user clicks "Copy Link", leaking the cross-origin URL.
Suggested Fix
Calculate the absolute position of the iframe using getBoundingClientRect() combined with the parent window's scroll offset (window.pageXOffset / pageYOffset). This ensures the conversion to iframe-local coordinates is accurate regardless of ancestor DOM positioning.
const rect = element.getBoundingClientRect();
const absoluteLeft = rect.left + window.pageXOffset;
const absoluteTop = rect.top + window.pageYOffset;
const payload = {
// ...
x: centerX - absoluteLeft,
y: centerY - absoluteTop,
};
Evaluated with Chrome root at commit: 4a3e9db74111a3c6c4b3acfd70050a05077cf27a
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The coordinate conversion subtracts element.offsetLeft and element.offsetTop, which are relative to the nearest positioned ancestor, from absolute page coordinates, producing incorrect iframe-local coordinates.
Impact
This could enable a UI redressing attack where a user who interacts with the resulting context menu, for example by choosing 'Copy Link', may inadvertently disclose sensitive cross-origin data such as password reset URLs or tokens to their clipboard.
What the attacker needed
Victim uses Chromium on iOS; victim long-presses a decoy element; victim chooses 'Copy Link' from the menu; attacker can embed a cross-origin iframe
The fix
The absolute position of the iframe should be calculated using getBoundingClientRect() combined with the parent window's scroll offset, so that the conversion to iframe-local coordinates is accurate regardless of ancestor DOM positioning.
How it was found
- The attacker embeds a cross-origin iframe pointing to a sensitive resource on the victim site.
- The attacker wraps the iframe in a positioned container so that the container becomes the offsetParent.
- The attacker applies CSS to the iframe so that it appears at the top-left but its offsetLeft and offsetTop are negative.
- The attacker overlays a decoy image at the top-left with opacity just below the threshold used by the opacity check.
- The user is tricked into long-pressing the decoy.
- The hit-test falls through to the iframe, and the script calculates shifted coordinates, so the context menu is generated for a sensitive element inside the victim iframe.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you long-press a link on a phone, the browser works out which element you touched. This report says that for iframes (embedded pages), the browser used the wrong reference point for that calculation. By carefully arranging page elements, an attacker could make the browser think you touched a different, sensitive link inside another site, and if you then choose 'Copy Link', that link could end up on your clipboard.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.