githubEdit

SOME - Same Origin Method Execution

circle-check

Same Origin Method Execution

There will be occasions where you can execute some limited javascript in a page. For example, in the case where you can control a callback value that will be executed.

In those case, one of the best things that you could do is to access the DOM to call whatever sensitive action you can find in there (like clicking a button). However, usually you will find this vulnerability in small endpoints without any interesting thing in the DOM.

In those scenarios, this attack will be very useful, because its goal is to be able to abuse the limited JS execution inside a DOM from a different page from the same domain with much interesting actions.

Basically, the attack flow is the following:

  • Find a callback that you can abuse (potentially limited to [\w\._]).

    • If it's not limited and you can execute any JS, you could just abuse this as a regular XSS

  • Make the victim open a page controlled by the attacker

  • The page will open itself in a different window (the new window will have the object opener referencing the initial one)

  • The initial page will load the page where the interesting DOM is located.

  • The second page will load the vulnerable page abusing the callback and using the opener object to access and execute some action in the initial page (which now contains the interesting DOM).

triangle-exclamation

Exploitation

Example

References

circle-check

Last updated