Project: chromium Issues People Development process History Sign in
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
User never visited
Closed: Jun 2011
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 0
Type: Bug-Security

  • Only users with EditIssue permission may comment.

Sign in to add a comment
XSS injection via prototype chain
Reported by, Jun 24 2011 Back to list
Chrome Version       : 12.0.742.100
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5:
Firefox 4.x:
IE 7/8/9:

cross-domain iframe able to inject arbitrary function in window.location prototype,
and call by main page.

What steps will reproduce the problem?
1. Make a page in

<meta charset="utf-8">
<script type="text/javascript">

function onLoad() {
	console.log("'fun' in location: ", "fun" in window.location);
	console.log("'fun' in document: ", "fun" in document);
	if ("fun" in window.location)

<body onLoad="onLoad();">
    <iframe width="100" height="100"

2. Make another page in
Which inject 

<meta charset="utf-8">
<script type="text/javascript">

// Make sure touch top window location first, get the hook to inject function.;

//*/ Inject cross domain function via Object.prototype = function() {
	return("from iframe : " + window.location);

/*/ Inject cross domain function via location.__proto__ = function() {
	return("from iframe : " + window.location);

3. Browse

What is the expected result?

Console log
'fun' in location:  true
index01.html:10'fun' in document:  false
index01.html:12from iframe :

What happens instead?

Console log
'fun' in location:  false
index01.html:10'fun' in document:  false

Please provide any additional information below. Attach a screenshot if

Sorry paste wrong result

expected result should be:

Console log
'fun' in location:  false
index01.html:10'fun' in document:  false

What happens instead should be:

Console log
'fun' in location:  true
index01.html:10'fun' in document:  false
index01.html:12from iframe :
Labels: -Type-Bug Type-Security
Comment 3 by, Jun 24 2011
Labels: -Pri-2 Pri-0 Restrict-View-SecurityTeam
Putting up the flags (verification and triage still needed).
Labels: SecSeverity-Medium reward-topanel
Status: Available
(Adam, any interest?)

Online repro:
(Modified to use alert() if there is a problem, silent if not).
Fires on Chrome trunk, 13 beta.
We tested Safari, and it didn't fire so it could be a V8-bindings specific issue.

@shih.weilung: Can this be used to:
- _override_ existing functions in the parent frame?
- Inject a function the other way around? e.g. the parent frame injects into the child frame?
If so, the severity could be higher but I'm going with Medium for now.
Comment 5 by, Jun 24 2011
Comment 6 by, Jun 25 2011
Labels: -Area-Undefined Area-WebKit
Sigh.  JavaScriptCore used to have the same bug.  I though we'd fixed all of these.
Status: Assigned
Comment 8 by, Jun 26 2011
Status: Started

I'm working up a patch for this issue.  Details in the WebKit bug.

@shih.weilung: If you create an account on, I'll CC you on the WebKit bug (which is where the patch and any associated discussion will take place).
Comment 9 by, Jun 26 2011
Patch posted upstream for review.
Thanks, I created an account with same email address on the WebKit bug.
Status: WillMerge
Thanks Adam!

Committed r89782: <>
Labels: Mstone-13 ReleaseBlock-Stable
Status: FixUnreleased
Merged to M13:
Comment 14 by, Jun 28 2011
Apologies for the spam, but this is an update to test changes to  Unfortunately, the test requires that I send email :(
@shih.weilung: how would you like to be credited in our release notes?
Please take a look at  issue 76748 , looks like same root cause.

Should we use the name "Shih Weilung", written just like that?
Yes, "Shih Weilung".
Labels: -Restrict-View-SecurityTeam -reward-topanel Restrict-View-SecurityNotify reward-500 reward-unpaid
@shih.weilung: congrats! Although "medium" severity, this bug is sufficiently interesting to attract a $500 Chromium Security Reward. Good find!

Boilerplate text:
Please do NOT publicly disclose details until a fix has been released to all our
users. Early public disclosure may cancel the provisional reward.
Also, please be considerate about disclosure when the bug affects a core library
that may be used by other products.
Please do NOT share this information with third parties who are not directly
involved in fixing the bug. Doing so may cancel the provisional reward.
Please be honest if you have already disclosed anything publicly or to third parties.
Sigh, already disclosed publicly.
Do you have a link for the public disclosure so that we can take a look?
Labels: CVE-2011-2795
@shih.weilung: we would still like to offer you the reward, despite the misunderstanding. To get any future rewards, all we ask is a chance to push the bugfix to stable users before it is publicly disclosed.

Thanks again for finding an interesting bug!
I'll keep that in mind.

One more thing, my name in passport is "Shih, Wei-Long".
Sorry for any inconvenience.
Labels: SecImpacts-Stable
Batch update.
@shih.weilung: please e-mail to collect the reward.
Labels: -reward-unpaid
Payment in system.
Lifting view restrictions.
Labels: -Restrict-View-SecurityNotify
Lifting view restrictions.
Status: Fixed
Project Member Comment 33 by, 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 34 by, Mar 10 2013
Labels: -Type-Security -Area-WebKit -SecSeverity-Medium -Mstone-13 -SecImpacts-Stable Cr-Content Security-Impact-Stable Security-Severity-Medium M-13 Type-Bug-Security
Project Member Comment 35 by, Mar 13 2013
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Project Member Comment 36 by, Mar 21 2013
Labels: -Security-Impact-Stable Security_Impact-Stable
Project Member Comment 37 by, Mar 21 2013
Labels: -Security-Severity-Medium Security_Severity-Medium
Project Member Comment 38 by, Apr 6 2013
Labels: -Cr-Content Cr-Blink
Project Member Comment 39 by, Oct 1 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Project Member Comment 40 by, Oct 2 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Labels: allpublic
Sign in to add a comment