CVE-2025-1097、CVE-2025-1098、CVE-2025-24514、CVE-2025-1974 分析報告

Overview Ingress-NGINX 是一個 Ingress controller 可以拿來讓 Kubernetes 的 application 暴露到外網,他會接受傳入的流量,並且架接到相關 Kubernetes 服務,那 Kubernetes 服務又會基於一組原則把流量轉發到 POD,總結來說 Ingress-NGINX 是做反向代理的 那官方也在文件直接推薦使用 Ingress-nginx 作為 Ingress controller Product Version Ingress-NGINX 1.11.5 以下的版本 Root Cause Analysis Remote NGINX Configuration Injection 處理傳入的請求時,Admissin controller 會基於模板跟 ingress 生成臨時的設定文件,並且會使用 nginx -t 測試是否有效 1// testTemplate checks if the NGINX configuration inside the byte array is valid 2// running the command "nginx -t" using a temporal file. 3func (n *NGINXController) testTemplate(cfg []byte) error { 4... 5 tmpfile, err := os.CreateTemp(filepath.Join(os.TempDir(), "nginx"), tempNginxPattern) 6... 7 err = os.WriteFile(tmpfile.Name(), cfg, file.ReadWriteByUser) 8... 9 out, err := n.command.Test(tmpfile.Name()) 10 11func (nc NginxCommand) Test(cfg string) ([]byte, error) { 12 //nolint:gosec // Ignore G204 error 13 return exec.Command(nc.Binary, "-c", cfg, "-t").CombinedOutput() 14} 不過通常只有 Kubernetes API 可以發送這一種 request,但因為 admission controller 缺乏驗證,所以如果有訪問的權力就可以去製造特定請求並且從任意 POD 發送 先使用 Kube-Review 創建 Ingress Resource 的 request,並透過 HTTP 直接傳送到 admission controller ...

2025-06-14 · 8 min · 1601 words · YJK

CVE-2024-2961 分析報告

Overview CVE-2024-2961 是一個發生在 GNU C Library(glibc)中 iconv() 函式的記憶體破壞漏洞。該漏洞源於編碼轉換模組 iconvdata/iso-2022-cn-ext.c,在處理特定中文字符(如「劄」「䂚」)並轉換為 ISO-2022-CN-EXT 編碼時,未正確檢查輸出 buffer 大小,導致會有 1–3 bytes 的 Out-of-Bounds (OOB) Write。 由於 iconv 常被用於 PHP,因此該漏洞可以與 php://filter/convert.iconv.* 結合,造成 Overflow,進而實現 leak、甚至達成 RCE。 Affected Versions glibc iconv:支援 ISO-2022-CN-EXT 的版本 PHP:多數版本(含 PHP 7.x, 8.x) 框架與系統:例如某些 Wordpress Plugin、PHP 7.0 的 Symfony 4.x 等,符合下列條件: 有 file_get_contents($_GET[‘file’]) 類似行為 可以透過 php://filter 執行 filter-chain Root Cause Analysis ISO-2022-CN-EXT 漏洞 由多個子字符集組成,專門用於轉換中文字,是 ISO-2022-CN 的擴充,可以做大量中文字元轉換 流程:需要編碼→發出轉義序列 (escape sequence) 告知需切換至哪個字符集 在處理 escape sequence 時僅在部分路徑做 buffer boundary 檢查 source code ...

2025-04-30 · 8 min · 1651 words · YJK

CVE-2025-24799/CVE-2025-24801 分析報告

Overview GLPI 是使用 PHP 開發的資訊資產管理系統,具備豐富的整合性功能,可連接 AD、各類 IT 應用與設備。由於其大量介接與自動化能力,長期以來具備多個潛在攻擊面,這次分析的主要是 CVE-2025-24799/CVE-2025-24801 兩個漏洞 CVE-2025-24799:GLPI Inventory API 中有一個 pre-auth SQL injection 漏洞,可經由 XML 傳入惡意的 device ID,導致 SQL injection,可以進一步控制資料庫。 CVE-2025-24801:透過預設啟用功能與系統機制,可將 SQLi 的漏洞利用擴展從 LFI 到 RCE,達成完整攻擊鏈。 此攻擊鏈由於無須經過身分驗證因此可以由未驗證攻擊者觸發,導致 RCE。 Product Version Product:GLPI Version:10.0.17 Language/Platform:PHP 8.x, Apache/Nginx, MySQL Mode:Inventory Agent API、Calendar、Marketplace、TCPDF Root Cause Analysis Pre-auth SQL Injection (CVE-2025-24799) 漏洞在 GLPI 的 Inventory 原生功能(通常是啟用狀態),不用身分驗證即可觸發,漏洞點在 /src/Agent.php 裡面的 handleAgent() 呼叫到 dbEscapeRecursive() 的地方,首先看一下 handleAgent() /src/Agent.php:handleAgent() 1<?php 2 public function handleAgent($metadata) 3 { 4 /** @var array $CFG_GLPI */ 5 global $CFG_GLPI; 6 7 $deviceid = $metadata['deviceid']; 8 9 $aid = false; 10 if ($this->getFromDBByCrit(Sanitizer::dbEscapeRecursive(['deviceid' => $deviceid]))) { 11 $aid = $this->fields['id']; 12 } 可以發現 handleAgent() 會接收 user input 並且儲存到 $deviceid 等變數,接下來經過 Sanitizer function dbEscapeRecursive() 再傳給 getFromDBByCrit(),接下來看一下 getFromDBByCrit() ...

2025-03-20 · 3 min · 467 words · YJK