¡¾Îó²îͨ¸æ¡¿Kubernetes Ingress-nginx×¢½âÑéÖ¤ÈƹýÎó²î£¨CVE-2024-7646£©
Ðû²¼Ê±¼ä 2024-08-19Ò»¡¢Îó²î¸ÅÊö
Îó²îÃû³Æ | Kubernetes Ingress-nginx×¢½âÑéÖ¤ÈƹýÎó²î | ||
CVE ID | CVE-2024-7646 | ||
Îó²îÀàÐÍ | ÑéÖ¤Èƹý¡¢ÏÂÁî×¢Èë | ·¢Ã÷ʱ¼ä | 2024-08-19 |
Îó²îÆÀ·Ö | 8.8 | Îó²îÆ·¼¶ | ¸ßΣ |
¹¥»÷ÏòÁ¿ | ÍøÂç | ËùÐèȨÏÞ | µÍ |
ʹÓÃÄÑ¶È | µÍ | Óû§½»»¥ | ÎÞ |
PoC/EXP | δ¹ûÕæ | ÔÚҰʹÓà | δ·¢Ã÷ |
ingress-nginxÊÇKubernetesÖÐÒ»¸öÊ¢ÐеÄIngress¿ØÖÆÆ÷£¬ËüʹÓÃNGINX×÷Ϊ·´ÏòÊðÀíºÍ¸ºÔØƽºâÆ÷£¬Ö¼ÔÚÓÃÓÚÖÎÀíÍⲿ»á¼ûµ½Kubernetes¼¯ÈºÄÚ²¿·þÎñµÄ·ÓÉ¡£
2024Äê8ÔÂ19ÈÕ£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø¼¯ÍÅVSRC¼à²âµ½Ingress-nginxÖб£´æÒ»¸öÑéÖ¤ÈƹýÏÂÁî×¢ÈëÎó²î£¨CVE-2024-7646£©£¬¸ÃÎó²îµÄCVSSÆÀ·ÖΪ8.8¡£
ingress-nginx ¿ØÖÆÆ÷ v1.11.2֮ǰ°æ±¾ÖУ¬ÓÐȨÔÚKubernetes¼¯ÈºÖн¨ÉèIngress¹¤¾ß£¨ÊôÓÚnetworking.k8s.io»òextensions API×飩µÄÍþвÕß¿ÉÒÔÈƹý×¢½âÑéÖ¤²¢×¢Èëí§ÒâÏÂÁ½ø¶ø»ñÈ¡ingress-nginx¿ØÖÆÆ÷µÄƾ֤£¬»á¼û¼¯ÈºÖд洢µÄËùÓÐÃô¸ÐÐÅÏ¢¡£
¶þ¡¢Ó°Ïì¹æÄ£
ingress-nginx controller < v1.11.2
Èý¡¢Çå¾²²½·¥
3.1 Éý¼¶°æ±¾
ÏÖÔÚ¸ÃÎó²îÒѾÐÞ¸´£¬ÊÜÓ°ÏìÓû§¿ÉÉý¼¶µ½ingress-nginx controller v1.11.2¡£
ÏÂÔØÁ´½Ó£º
https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.11.2
3.2 ÔÝʱ²½·¥
¸ÃÎó²îÓ°Ïì ingress-nginx£¬ÈôÊǼ¯ÈºÉÏδװÖà ingress-nginx£¬Ôò²»»áÊܵ½Ó°Ïì¡£¿ÉÒÔͨ¹ýÒÔÏ·½·¨Ö®Ò»À´¼ì²é¼¯ÈºÉÏÊÇ·ñ±£´æ ingress-nginx¿ØÖÆÆ÷£º
1.¼ì²éÊÇ·ñ±£´æ ingress-nginx ÃüÃû¿Õ¼ä£º
ʹÓÃkubectl get namespacesÏÂÁÈôÊÇÊä³öÖаüÀ¨ ingress-nginx£¬ÔòÅú×¢¼¯ÈºÖб£´æÓë ingress-nginx Ïà¹ØµÄ×ÊÔ´£»»òÕßͨ¹ýkubectl get all -n ingress-nginxÏÂÁîÁгö ingress-nginx ÃüÃû¿Õ¼äÖÐËùÓÐµÄ Pod¡¢·þÎñ¡¢°²ÅŵÈ×ÊÔ´¡£ÈôÊÇ¿´µ½ÖøÃûΪ ingress-nginx-controller µÄ Deployment »ò Pod£¬ËµÃ÷ ingress-nginx ¿ØÖÆÆ÷ÒѾװÖá£
2. ͨ¹ýÔÚKubernetes ÇéÐÎÖвéÕÒÓë ingress-nginx-controller Ïà¹ØµÄ Pod£º
kubectl get po -A | grep ingress-nginx-controller
3.¼ì²éÊÇ·ñ±£´æ ingress-nginx-controller °²ÅÅ
ʹÓÃÏÂÁîkubectl get deployments --all-namespaces | grep ingress-nginx£¬ÈôÊÇÊä³öÖаüÀ¨ ingress-nginx-controller °²ÅÅ£¬ËµÃ÷ ingress-nginx ¿ØÖÆÆ÷Òѱ»×°Öá£
¼ì²âÓ뻺½â
ÖÎÀíÔ±¿Éͨ¹ý¼ì²é Kubernetes Éó¼ÆÈÕÖ¾ÖÐÊÇ·ñ±£´æÈκοÉÒÉµÄ Ingress ¹¤¾ß£¬ÓÈÆäÊÇ°üÀ¨»Ø³µ·û ( \r) µÄ×¢½â£¬ÓÉÓڻسµ·û£¨\r£©¿ÉÄܱ»ÓÃÓÚ×¢Èë¶ñÒâ´úÂë»òÈƹýijЩÑéÖ¤»úÖÆ¡£ÈôÊÇÔÚ Kubernetes Éó¼ÆÈÕÖ¾Öз¢Ã÷°üÀ¨»Ø³µ·û (\r) µÄ×¢½â£¬È·ÈÏÊÇ·ñ±£´æ¶ñÒâ»òÒì³£µÄÄÚÈÝ¡£¿ÉÒÔʹÓà kubectl get ingress <ingress-name> -o yaml ÏÂÁîÉó²éÏêϸµÄÉèÖá£ÈôÊÇÈ·ÈÏÓжñÒâ×¢½â»ò²»Çå¾²µÄÉèÖ㬿É˼Á¿£º
l ÔÝʱ¸ôÀëÊÜÓ°ÏìµÄ·þÎñ»òÃüÃû¿Õ¼ä£¬ÒÔ±ÜÃâ½øÒ»²½¹¥»÷£»
l ɾ³ý»òÐÞ¸´ Ingress£ºÍ¨¹ý kubectl delete ingress <ingress-name> ɾ³ýÊÜÓ°ÏìµÄ Ingress ¹¤¾ß£¬»òÕßÊÖ¶¯±à¼×¢½âÈ¥³ý²»Çå¾²µÄ×Ö·û¡£ÐÞ¸´ºóµÄ¹¤¾ßÓ¦ÖØÐÂÓ¦ÓÃÖÁ¼¯ÈºÖС£
3.3 ͨÓý¨Òé
l °´ÆÚ¸üÐÂϵͳ²¹¶¡£¬ïÔÌϵͳÎó²î£¬ÌáÉý·þÎñÆ÷µÄÇå¾²ÐÔ¡£
l ÔöǿϵͳºÍÍøÂçµÄ»á¼û¿ØÖÆ£¬Ð޸ķÀ»ðǽսÂÔ£¬¹Ø±Õ·ÇÐëÒªµÄÓ¦Óö˿ڻò·þÎñ£¬ïÔ̽«Î£ÏÕ·þÎñ£¨ÈçSSH¡¢RDPµÈ£©Ì»Â¶µ½¹«Íø£¬ïÔ̹¥»÷Ãæ¡£
l ʹÓÃÆóÒµ¼¶Çå¾²²úÆ·£¬ÌáÉýÆóÒµµÄÍøÂçÇå¾²ÐÔÄÜ¡£
l ÔöǿϵͳÓû§ºÍȨÏÞÖÎÀí£¬ÆôÓöàÒòËØÈÏÖ¤»úÖƺÍ×îСȨÏÞÔÔò£¬Óû§ºÍÈí¼þȨÏÞÓ¦¼á³ÖÔÚ×îµÍÏ޶ȡ£
l ÆôÓÃÇ¿ÃÜÂëÕ½ÂÔ²¢ÉèÖÃΪ°´ÆÚÐ޸ġ£
3.4 ²Î¿¼Á´½Ó
https://groups.google.com/g/kubernetes-security-announce/c/a1__cKjWkfA
https://github.com/kubernetes/kubernetes/issues/126744
ËÄ¡¢°æ±¾ÐÅÏ¢
°æ±¾ | ÈÕÆÚ | ±¸×¢ |
V1.0 | 2024-08-19 | Ê×´ÎÐû²¼ |
Îå¡¢¸½Â¼
5.1 ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø¼ò½é
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø½¨ÉèÓÚ1996Ä꣬ÊÇÓÉÁôÃÀ²©Ê¿ÑÏÍû¼ÑŮʿ½¨ÉèµÄ¡¢ÓµÓÐÍêÈ«×ÔÖ÷֪ʶ²úȨµÄÐÅÏ¢Çå¾²¸ß¿Æ¼¼ÆóÒµ¡£ÊǺ£ÄÚ×î¾ßʵÁ¦µÄÐÅÏ¢Çå¾²²úÆ·¡¢Çå¾²·þÎñ½â¾ö¼Æ»®µÄÁ캽ÆóÒµÖ®Ò»¡£
¹«Ë¾×ܲ¿Î»ÓÚ±±¾©ÊÐÖйشåÈí¼þÔ°ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø´óÏ㬹«Ë¾Ô±¹¤6000ÓàÈË£¬Ñз¢ÍŶÓ1200ÓàÈË, ÊÖÒÕ·þÎñÍŶÓ1300ÓàÈË¡£ÔÚÌìϸ÷Ê¡¡¢ÊС¢×ÔÖÎÇøÉèÁ¢·ÖÖ§»ú¹¹ÁùÊ®¶à¸ö£¬ÓµÓÐÁýÕÖÌìϵÄÏúÊÛϵͳ¡¢ÇþµÀϵͳºÍÊÖÒÕÖ§³Öϵͳ¡£¹«Ë¾ÓÚ2010Äê6ÔÂ23ÈÕÔÚÉîÛÚÖÐС°å¹ÒÅÆÉÏÊС££¨¹ÉƱ´úÂ룺002439£©
¶àÄêÀ´£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÖÂÁ¦ÓÚÌṩ¾ßÓйú¼Ê¾ºÕùÁ¦µÄ×ÔÖ÷Á¢ÒìµÄÇå¾²²úÆ·ºÍ×î¼Ñʵ¼ù·þÎñ£¬×ÊÖú¿Í»§ÖÜÈ«ÌáÉýÆäIT»ù´¡ÉèÊ©µÄÇå¾²ÐÔºÍÉú²úЧÄÜ£¬Îª´òÔìºÍÌáÉý¹ú¼Ê»¯µÄÃñ×åÐÅÏ¢Çå¾²¹¤ÒµÁì¾üÆ·Åƶø²»Ð¸Æ𾢡£
5.2 ¹ØÓÚÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÇå¾²Ó¦¼±ÏìÓ¦ÖÐÐÄÒÑÐû²¼1000¶à¸öÎó²îͨ¸æºÍΣº¦Ô¤¾¯£¬ÎÒÃǽ«Ò»Á¬¸ú×ÙÈ«Çò×îеÄÍøÂçÇå¾²ÊÂÎñºÍÎó²î£¬ÎªÆóÒµµÄÐÅÏ¢Çå¾²±£¼Ý»¤º½¡£
¹Ø×¢ÎÒÃÇ£º