¡¾Îó²îͨ¸æ¡¿RustÏÂÁî×¢ÈëÎó²î£¨CVE-2024-24576£©
Ðû²¼Ê±¼ä 2024-04-10Ò»¡¢Îó²î¸ÅÊö
Îó²îÃû³Æ | RustÏÂÁî×¢ÈëÎó²î | ||
CVE ID | CVE-2024-24576 | ||
Îó²îÀàÐÍ | ÏÂÁî×¢Èë | ·¢Ã÷ʱ¼ä | 2024-04-10 |
Îó²îÆÀ·Ö | 10.0 | Îó²îÆ·¼¶ | ÑÏÖØ |
¹¥»÷ÏòÁ¿ | ÍøÂç | ËùÐèȨÏÞ | ÎÞ |
ʹÓÃÄÑ¶È | µÍ | Óû§½»»¥ | ÎÞ |
PoC/EXP | δ֪ | ÔÚҰʹÓà | δ֪ |
RustÊÇÒ»ÖÖͨÓᢱàÒëÐͱà³ÌÓïÑÔ£¬Ç¿µ÷ÐÔÄÜ¡¢ÀàÐÍÇå¾²ºÍ²¢·¢ÐÔ£¬Ö§³Öº¯Êýʽ¡¢²¢·¢Ê½¡¢Àú³ÌʽÒÔ¼°ÃæÏò¹¤¾ßµÄ±à³ÌÆø¸Å¡£
2024Äê4ÔÂ10ÈÕ£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøVSRC¼à²âµ½Rust ±ê×¼¿âÖб£´æÏÂÁî×¢ÈëÎó²î£¨CVE-2024-24576£¬±»³ÆΪBatBadBut£©£¬¸ÃÎó²îµÄCVSSÆÀ·ÖΪ10.0£¬¿ÉÄÜÔÚWindowsϵͳÉϵ¼ÖÂÏÂÁî×¢Èë¹¥»÷£¬ÏÖÔÚ¸ÃÎó²îµÄϸ½ÚÒѹûÕæ¡£
Rust±ê×¼¿â1.77.2 °æ±¾Ö®Ç°£¬ÔÚ Windows ÉÏʹÓÃCommand API ŲÓÃÅú´¦Öóͷ£Îļþ£¨´øÓÐbatºÍcmdÀ©Õ¹Ãû£©Ê±£¬Rust ±ê×¼¿âûÓÐ׼ȷתÒåÅú´¦Öóͷ£ÎļþµÄ²ÎÊý£¬Äܹ»¿ØÖÆת´ï¸øÌìÉúÀú³ÌµÄ²ÎÊýµÄ¹¥»÷Õß¿ÉÈƹýתÒåÖ´ÐÐí§Òâshell ÏÂÁî¡£
¶þ¡¢Îó²î¸´ÏÖ
Èý¡¢Ó°Ïì¹æÄ£
Rust < 1.77.2£¨Windowsƽ̨£©
×¢£ºÈôÊÇ´úÂë»òÒÀÀµÏî֮һʹÓò»ÊÜÐÅÍеIJÎÊýÖ´ÐÐÅú´¦Öóͷ£Îļþ£¬Ôò Windows ÉÏ 1.77.2 ֮ǰµÄËùÓÐ Rust °æ±¾¶¼»áÊܵ½Ó°Ï죬ÆäËûƽ̨»òʹÓò»Ò×Êܵ½Ó°Ïì¡£
BatBadButÎó²îÔÊÐí¹¥»÷ÕßÔÚÖª×ãÌض¨Ìõ¼þʱ¶Ô¼ä½ÓÒÀÀµCreateProcessº¯ÊýµÄWindowsÓ¦ÓóÌÐòÖ´ÐÐÏÂÁî×¢Èë¡£CreateProcessº¯ÊýÔÚÖ´ÐÐÅú´¦Öóͷ£Îļþʱ»áÒþʽÌìÉúcmd.exe¡£
BatBadButÎó²î¿ÉÄÜÓ°ÏìErlang¡¢Go¡¢Haskell¡¢Java¡¢Node.js¡¢PHP¡¢Python¡¢Ruby¡¢RustµÈ¶àÖÖ±à³ÌÓïÑÔ£¬µ±±à³ÌÓïÑÔ·â×° CreateProcess º¯Êý²¢ÎªÏÂÁî²ÎÊýÌí¼ÓתÒå»úÖÆʱ±£´æÇå¾²ÎÊÌ⣬µ¼Ö¶ñÒâÏÂÁîÐвÎÊý¿ÉÄÜÄܹ»Ö´ÐÐÏÂÁî×¢Èë¡£
Ïà¹ØCVE°üÀ¨CVE-2024-1874¡¢CVE-2024-22423¡¢CVE-2024-24576£¨Rust£©¡¢CVE-2024-3566 ¡¢CVE-2024-27980£¨Node.js£©µÈ£¬ÏÖÔÚPHP¡¢Rust¡¢Node.jsµÈ±à³ÌÓïÑÔÒÑÐû²¼ÁËÐÞ¸´°æ±¾£¬ÏêÇé¿É²Î¿¼£ºhttps://kb.cert.org/vuls/id/123335
ËÄ¡¢Çå¾²²½·¥
4.1 Éý¼¶°æ±¾
ÏÖÔÚ¹Ù·½ÒÑÔÚRust °æ±¾1.77.2Öлº½âÐÞ¸´Á˸ÃÎó²î£¬Ë¢ÐÂÁËתÒå´úÂëµÄÎȽ¡ÐÔ£¬²¢¸ü¸ÄÁËCommand API£¬Ê¹ÆäÔÚÎÞ·¨Çå¾²µØתÒå²ÎÊýʱ·µ»ØInvalidInput¹ýʧ¡£ÊÜÓ°ÏìÓû§¿É¸üе½Rust 1.77.2»ò¸ü¸ß°æ±¾¡£
ÏÂÔØÁ´½Ó£º
https://blog.rust-lang.org/2024/04/09/Rust-1.77.2.html
°æ±¾¼ì²â£º
ÔÚWindows cmd »ò PowershellÖÐÖ´ÐÐÏÂÁrustc --version»òÕß rustc -V
4.2 ÔÝʱ²½·¥
×èÖ¹ÔÚWindowsÉÏʹÓò»ÊÜÐÅÍеIJÎÊýŲÓÃÅú´¦Öóͷ£Îļþ¡£
4.3 ͨÓý¨Òé
l °´ÆÚ¸üÐÂϵͳ²¹¶¡£¬ïÔÌϵͳÎó²î£¬ÌáÉý·þÎñÆ÷µÄÇå¾²ÐÔ¡£
l ÔöǿϵͳºÍÍøÂçµÄ»á¼û¿ØÖÆ£¬Ð޸ķÀ»ðǽսÂÔ£¬¹Ø±Õ·ÇÐëÒªµÄÓ¦Óö˿ڻò·þÎñ£¬ïÔ̽«Î£ÏÕ·þÎñ£¨ÈçSSH¡¢RDPµÈ£©Ì»Â¶µ½¹«Íø£¬ïÔ̹¥»÷Ãæ¡£
l ʹÓÃÆóÒµ¼¶Çå¾²²úÆ·£¬ÌáÉýÆóÒµµÄÍøÂçÇå¾²ÐÔÄÜ¡£
l ÔöǿϵͳÓû§ºÍȨÏÞÖÎÀí£¬ÆôÓöàÒòËØÈÏÖ¤»úÖƺÍ×îСȨÏÞÔÔò£¬Óû§ºÍÈí¼þȨÏÞÓ¦¼á³ÖÔÚ×îµÍÏ޶ȡ£
l ÆôÓÃÇ¿ÃÜÂëÕ½ÂÔ²¢ÉèÖÃΪ°´ÆÚÐ޸ġ£
4.4 ²Î¿¼Á´½Ó
https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html
https://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh
https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/
https://kb.cert.org/vuls/id/123335
Îå¡¢°æ±¾ÐÅÏ¢
°æ±¾ | ÈÕÆÚ | ±¸×¢ |
V1.0 | 2024-04-10 | Ê×´ÎÐû²¼ |
V1.1 | 2024-04-12 | ÐÂÔöÎó²î¸´ÏÖ¡¢Ïà¹ØCVEÐÅÏ¢¼°°æ±¾¼ì²â |
Áù¡¢¸½Â¼
6.1 ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø¼ò½é
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø½¨ÉèÓÚ1996Ä꣬ÊÇÓÉÁôÃÀ²©Ê¿ÑÏÍû¼ÑŮʿ½¨ÉèµÄ¡¢ÓµÓÐÍêÈ«×ÔÖ÷֪ʶ²úȨµÄÐÅÏ¢Çå¾²¸ß¿Æ¼¼ÆóÒµ¡£ÊǺ£ÄÚ×î¾ßʵÁ¦µÄÐÅÏ¢Çå¾²²úÆ·¡¢Çå¾²·þÎñ½â¾ö¼Æ»®µÄÁ캽ÆóÒµÖ®Ò»¡£
¹«Ë¾×ܲ¿Î»ÓÚ±±¾©ÊÐÖйشåÈí¼þÔ°ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø´óÏ㬹«Ë¾Ô±¹¤6000ÓàÈË£¬Ñз¢ÍŶÓ1200ÓàÈË, ÊÖÒÕ·þÎñÍŶÓ1300ÓàÈË¡£ÔÚÌìϸ÷Ê¡¡¢ÊС¢×ÔÖÎÇøÉèÁ¢·ÖÖ§»ú¹¹ÁùÊ®¶à¸ö£¬ÓµÓÐÁýÕÖÌìϵÄÏúÊÛϵͳ¡¢ÇþµÀϵͳºÍÊÖÒÕÖ§³Öϵͳ¡£¹«Ë¾ÓÚ2010Äê6ÔÂ23ÈÕÔÚÉîÛÚÖÐС°å¹ÒÅÆÉÏÊС££¨¹ÉƱ´úÂ룺002439£©
¶àÄêÀ´£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÖÂÁ¦ÓÚÌṩ¾ßÓйú¼Ê¾ºÕùÁ¦µÄ×ÔÖ÷Á¢ÒìµÄÇå¾²²úÆ·ºÍ×î¼Ñʵ¼ù·þÎñ£¬×ÊÖú¿Í»§ÖÜÈ«ÌáÉýÆäIT»ù´¡ÉèÊ©µÄÇå¾²ÐÔºÍÉú²úЧÄÜ£¬Îª´òÔìºÍÌáÉý¹ú¼Ê»¯µÄÃñ×åÐÅÏ¢Çå¾²¹¤ÒµÁì¾üÆ·Åƶø²»Ð¸Æ𾢡£
6.2 ¹ØÓÚÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÇå¾²Ó¦¼±ÏìÓ¦ÖÐÐÄÒÑÐû²¼1000¶à¸öÎó²îͨ¸æºÍΣº¦Ô¤¾¯£¬ÎÒÃǽ«Ò»Á¬¸ú×ÙÈ«Çò×îеÄÍøÂçÇå¾²ÊÂÎñºÍÎó²î£¬ÎªÆóÒµµÄÐÅÏ¢Çå¾²±£¼Ý»¤º½¡£
¹Ø×¢ÎÒÃÇ£º