repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
some-same-origin-method-execution.mdMarkdown54 lines3.5 KiBsource raw download

title: "SOME - Same Origin Method Execution" section: "Web Pentesting" sectionSlug: "pentesting-web" sourcePath: "src/pentesting-web/xss-cross-site-scripting/some-same-origin-method-execution.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/pentesting-web/xss-cross-site-scripting/some-same-origin-method-execution.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

SOME - Same Origin Method Execution#

Same Origin Method Execution#

Sometimes an application provides only constrained JavaScript execution, such as control of a callback identifier that the server inserts into a script response.

If that execution occurs in a page with a useful DOM, it may invoke sensitive methods or click controls. The vulnerable callback endpoint itself, however, is often a minimal document with no valuable UI.

SOME bridges that gap: the constrained script runs in a same-origin auxiliary window and uses its window.opener reference to reach a more interesting document in the opener.[1]

Basically, the attack flow is the following:

[!CAUTION] A window reference can survive navigation of the referenced browsing context, although same-origin policy checks are evaluated against the documents' current origins. Modern isolation features such as Cross-Origin-Opener-Policy and rel=noopener can sever the relationship.

To dereference the opener's DOM, the auxiliary page and the opener's current document must be same-origin. The chain therefore needs same-origin script execution, such as the vulnerable callback endpoint itself.

Exploitation#

Example#

References#