mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 870870 - Check message targets for about:healthreport. r=MattN
This commit is contained in:
parent
cf23a40c78
commit
4433b7f3d7
@ -110,6 +110,15 @@ var healthReportWrapper = {
|
||||
},
|
||||
|
||||
handleRemoteCommand: function (evt) {
|
||||
// Do an origin check to harden against the frame content being loaded from unexpected locations.
|
||||
let allowedPrincipal = Services.scriptSecurityManager.getCodebasePrincipal(this._getReportURI());
|
||||
let targetPrincipal = evt.target.nodePrincipal;
|
||||
if (!allowedPrincipal.equals(targetPrincipal)) {
|
||||
Cu.reportError(`Origin check failed for message "${evt.detail.command}": ` +
|
||||
`target origin is "${targetPrincipal.origin}", expected "${allowedPrincipal.origin}"`);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (evt.detail.command) {
|
||||
case "DisableDataSubmission":
|
||||
this.setDataSubmission(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user