證券暨期貨法令判解查詢系統 網站資料庫注入漏洞 - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2024-01119
  •  發信 Vendor: 財團法人中華民國證券暨期貨市場發展基金會
  • Title: 證券暨期貨法令判解查詢系統 網站資料庫注入漏洞
  • Introduction: 該網站首頁的查詢功能有 SQL Injection 漏洞

處理狀態

目前狀態

公開
Last Update : 2024/10/26
  • 新提交
  • 已審核
  • 已通報
  • 已修補
  • 已複測
  • 公開

處理歷程

  • 2024/09/17 00:48:11 : 新提交 (由 Sideman 更新此狀態)
  • 2024/09/20 11:42:28 : 新提交 (由 Sideman 更新此狀態)
  • 2024/09/20 11:49:37 : 新提交 (由 Sideman 更新此狀態)
  • 2024/09/20 11:50:24 : 新提交 (由 Sideman 更新此狀態)
  • 2024/09/25 16:56:16 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/09/25 16:56:40 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/04 18:28:33 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/04 18:28:33 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/04 18:28:33 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/07 11:41:48 : 修補中 (由 組織帳號 更新此狀態)
  • 2024/10/14 17:12:30 : 複測申請中 (由 組織帳號 更新此狀態)
  • 2024/10/23 02:38:17 : 確認已修補 (由 Sideman 更新此狀態)
  • 2024/10/26 03:00:07 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2024-01119
  • 通報者:sideman (Sideman)
  • 風險:高
  • 類型:資料庫注入攻擊 (SQL Injection)

參考資料

攻擊者可利用該漏洞取得後端資料庫權限及完整資料(包含大量使用者個資或敏感性資料),同時也有機會對資料進行破壞或修改。

漏洞說明: OWASP - SQL Injection
https://www.owasp.org/index.php/SQL_Injection

漏洞說明: OWASP - Top 10 - 2017 A1 - Injection
https://www.owasp.org/index.php/Top_10-2017_A1-Injection

漏洞說明: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
https://cwe.mitre.org/data/definitions/89.html

防護方式: OWASP - SQL Injection Prevention Cheat Sheet
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)

相關網址

https://www.selaw.com.tw/Chinese/IntegratedQuery/SearchResult?criteria.searchTypes=on&criteria.searchTypes=LAW&criteria.searchTypes=Judicial&criteria.searchTypes=SOrder&criteria.keyWord1=48763'

敘述

漏洞描述

該網址可以透過參數或是輸入在右上角的查詢欄位進行資料搜索,其中 criteria.keyWord1 參數沒有進行過濾導致 SQL Injection 產生

可以對 於網址 對該欄位輸入 ' 並得到 500 Internal Server Error 回應;輸入 '%2b' 得到 200 正常回應來確定漏洞存在。

500 Internal Server Error:
https://www.selaw.com.tw/Chinese/IntegratedQuery/SearchResult?criteria.searchTypes=on&criteria.searchTypes=LAW&criteria.searchTypes=Judicial&criteria.searchTypes=SOrder&criteria.keyWord1=48763'

200:
https://www.selaw.com.tw/Chinese/IntegratedQuery/SearchResult?criteria.searchTypes=on&criteria.searchTypes=LAW&criteria.searchTypes=Judicial&criteria.searchTypes=SOrder&criteria.keyWord1=48763'%2b'

經過測試,可以將原本的 GET 請求轉換成 POST 請求並使用 application/form-data 的格式方便後續操作,以下範例使用 Burp suite Community 工具進行操作

圖:送出 SQL Injection Payload 導致伺服器 500 Internal Server Error
圖片
圖片
圖片

圖:透過 OOB 的方式去獲取資料
圖片

修補建議

1. 使用 Prepared Statement 處理特殊字元

擷圖

留言討論

聯絡組織

 發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。
;