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 ...