Lucene search
K

Mozilla Firefox 3.6 window.location对象非授权数据访问漏洞

🗓️ 24 Mar 2010 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 54 Views

Mozilla Firefox 3.6 window.location对象非授权数据访问漏

Related
Code

                                                <!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=541530
-->
<head>
  <title>Test for Bug 411103</title>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

var passed = true;
function ok(test, message) {
    if (!test) {
        alert("FAIL: " + message);
        passed = false;
    }
}

var orig = window;
window = {};

var origLocation = location;

ok(window === orig, "can't override window");
ok(window.location === location, "properties are properly aliased");
ok(document.location === location, "properties are properly aliased");

try {
    __defineGetter__('window', function() {});
    ok(false, "should not be able to defineGetter(window)");
} catch (e) {
}

try {
    window.__defineGetter__('location', function(){});
    ok(false, "should not be able to defineGetter(window.location)");
} catch (e) {
}

try {
    window.location.__defineGetter__('href', function(){});
    ok(false, "shouldn't be able to override location.href");
} catch (e) {
}

try {
    window.location.__proto__.__defineGetter__('href', function(){});
    ok(false, "shouldn't be able to use the prototype");
} catch (e) {
}

try {
    window.location.__defineSetter__('href', function(){});
    ok(false, "overrode a setter for location.href?");
} catch (e) {
}

try {
    document.__defineGetter__('location', function(){});
    ok(false, "shouldn't be able to override document.location");
} catch (e) {
}

location.watch('href', function() {
                          return "javascript:ok(false, 'shouldn't be able to use watchpoints to mess things up')"
                       });

ok(window === orig, "can't override window");
ok(window.location === origLocation, "properties are properly aliased");
ok(document.location === origLocation, "properties are properly aliased");

location.href = 'javascript:ok(true, "was able to set location.href through a watchpoint")';

alert(passed ? "All tests passed" : "FAILED!");

</script>
</pre>
</body>
</html>
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

24 Mar 2010 00:00Current
9.3High risk
Vulners AI Score9.3
EPSS0.00499
54