ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab£ºVxWorks¶à¸öÔ¶³ÌÎó²îÆÊÎö
Ðû²¼Ê±¼ä 2019-08-02VxWorksÊÇÌìÏÂÉÏʹÓÃ×îÆÕ±éµÄʵʱ²Ù×÷ϵͳ£¨RTOS£©£¬ÓÐÁè¼Ý20ÒŲ́װ±¸ÕýÔÚʹÓ㬰üÀ¨¹¤Òµ¡¢µçÁ¦¡¢ÄÜÔ´£¬º½¿Õº½ÌìµÈÐÐÒµÒªº¦»ù´¡ÉèÊ©¡£
? Îó²îÓ°Ïì°æ±¾
URGENT/11Îó²îÓ°Ïì×Ô6.5°æÒÔÀ´µÄÏÕЩËùÓÐVxWorks°æ±¾£¬²»°üÀ¨ÎªÈÏÖ¤¶øÉè¼ÆµÄ²úÆ·°æ±¾£¬ÀýÈçVxWorks 653ºÍVxWorks Cert Edition¡£
? VxWorks6.5~6.9.4
? ʹÓÃIPNetÍøÂçÐÒéÕ»µÄVxWorks°æ±¾

? ½â¾ö¼Æ»®
? ·À»ðǽºÍIDS²úÆ·Ìí¼Ó¹æÔò£¬¼ì²âÒì³£Á÷Á¿¡£
? ʹÓÃ×îÐÂÎó²îɨÃ蹤¾ß¼ì²âÄÚ²¿ÊÜÎó²îÓ°ÏìµÄ×°±¸×ʲú¡£
? ·çºÓ(Wind River)¹«Ë¾ÒÑÐû²¼Ïà¹Ø°æ±¾¸üкͲ¹¶¡ÐÅÏ¢¡£
? ÂÞ¿ËΤ¶û(Rockwell)¡¢Sonicwall¡¢Ê©ÀÖ(Xerox)µÈ¹«Ë¾ÒÑÐû²¼¸üаü£¬Çëʵʱ¸üС£
? Îó²îÔÀíÆÊÎö
Armis LabsÔÚVxWorksÖй²·¢Ã÷ÁË11¸ö0dayÎó²î£¬ÆäÖÐ6¸öÎó²îΪÑÏÖØÎó²î²¢¿ÉÒÔÔ¶³ÌÖ´ÐдúÂ루RCE£©£¬ÆäÓà5¸öÎó²îΪ¾Ü¾ø·þÎñ£¬ÐÅϢ鶻òÂ߼ȱÏÝÎó²î¡£ÏêϸÈçϱíËùʾ£º

ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÑ¡È¡ÁËÈý¸ö½ÏÁ¿µä·¶µÄÎó²îCVE-2019-12255¡¢CVE-2019-12257¡¢CVE-2019-12258¾ÙÐÐÆÊÎö¡£ËüÃÇÉæ¼°µ½ÁËIPNetÐÒéÕ»¼°DHCPÐÒé´¦Öóͷ£ÊµÏÖ¡£
¡ø CVE-2019-12255Îó²îÆÊÎö
CVE-2019-12255Îó²îÊÇIPNetÐÒéÕ»ÔÚ´¦Öóͷ£TCP±¨ÎÄurg±ê¼ÇʱµÄÕûÊýÒç³öÎó²î¡£ÔÚÊÜÓ°Ïì°æ±¾µÄVxWorks TCPÐÒéջʵÏÖÖУ¬ÈôÊÇÒ»¸öTCP±¨ÎÄÉèÖÃÁËurg±ê¼Ç£¬ÄÇô¸ÃTCP±¨ÎĵÄurgent pointer×ֶλáÔÚiptcp_deliverº¯ÊýÖÐÓÃÓÚ±äÁ¿tcb-> recv.urg_ptrµÄ¸³Öµ¡£ÔÚVxWorks°æ±¾6.8°æ±¾ÖУ¬ÊµÏÖ´úÂëÈçÏÂËùʾ£º
ÔÚÒÔºósocketÖ´ÐÐrecv£¨£©²Ù×÷ʱ£¬»áŲÓú¯Êýiptcp_usr_get_from_recv_queue£¬¸Ãº¯Êý´¦Öóͷ£±¨ÎĶÎʱÊ×ÏÈÅжÏÄ¿½ñTCPÊý¾Ý¶ÎÊÇ·ñ°üÀ¨urgent±ê¼Ç£¬ÈôÊÇ°üÀ¨¸Ã±ê¼Ç£¬Ôò¼ì²éÊÇ·ñ»á½«Ä¿½ñTCP´°¿ÚÖеÄurgent Êý¾Ý¶ÁÈ¡³öÀ´£¨urgentÊý¾Ý²»ÔÊÐíͨ¹ýͨÀýrecv¶ÁÈ¡£©¡£¼ì²é·½·¨ÈçÏÂͼËùʾ£º

ÆäÖУ¬ugent_pointerÊÇÔÚº¯Êýiptcp_deliverÖи³ÖµµÄ£¬lenΪrecvº¯Êý²ÎÊý£¬ÈôÊÇͨ¹ýÅÌËã·¢Ã÷¶ÁÈ¡len³¤¶ÈµÄÊý¾Ý»á¶ÁÈ¡µ½urgent dataÊý¾Ý£¬ÔòÖØжÔlen¸³Öµ£¬ÒÔ°ü¹Üurgent Êý¾Ý²»±»¶ÁÈ¡¡£ÏÂÃæÁ½ÕÅͼչʾÁËÉÏÊö´úÂëµÄЧ¹û¡£


ÈôÊÇÎüÊÕµ½µÄTCP¶ÎÖеÄurgent_pointer×Ö¶ÎÉèÖÃΪ0£¬Ôòiptcp_usr_get_from_recv_queueͨ¹ýÅÌËã»ñµÃÐÞÕýºóµÄlenΪ-1¡£ÓÉÓÚlenÊÇÎÞ·ûºÅÕûÊý£¬¼´¼´ÊÇ0xffffffff¡£Õâµ¼ÖÂrecv£¨£©Å²ÓÃÖÐÉèÖõĶÁÈ¡³¤¶ÈÏÞÖÆʧЧ£¬´Ó¶ø¿½±´ËùÓпɶÁÈ¡µÄÊý¾Ýµ½Óû§»º³åÇø£¬Ôì³ÉÒç³ö¡£
Îó²îÑéÖ¤£º
ƾ֤Îó²îÔÀí£¬ÎÒÃDZàдÁ˸ÃÎó²îµÄPOCÑéÖ¤³ÌÐò£¬²¢ÔÚVxWorks6.8°æ±¾µÄϵͳÉϾÙÐÐÁËÑéÖ¤¡£Í¨¹ýÖ±½Ó·¢ËÍurgent pointerΪ0µÄÊý¾Ý°ü£¬Ôì³ÉÕ»Òç³öºóÁýÕÖº¯Êý·µ»ØµØµã£¬ÈçÏÂͼËùʾ£º

¡ø CVE-2019-12257Îó²îÆÊÎö
´ËÎó²îÊÇVxWorksϵͳװ±¸ÄÚÖõÄipdhcpc£¨VxWorksµÄÄÚÖÃDHCP¿Í»§¶Ë£©ÔÚ´¦Öóͷ£DHCPÏìÓ¦Êý¾Ý°üʱ´¥·¢µÄ¶ÑÒç³öÎó²î¡£µ±ipdhcpcʵÑé´ÓDHCP·þÎñÆ÷»ñÈ¡IPµØµãʱ£¬ÓëÄ¿µÄ×°±¸Î»ÓÚͳһ×ÓÍøÖеĹ¥»÷Õß¿ÉÒÔͨ¹ýÌØÊâÉè¼ÆµÄDHCPÏìÓ¦Êý¾Ý°ü»Ø¸´£¬Ê¹µÃVxWorksϵͳװ±¸±¬·¢¶ÑÒç³ö£¬´Ó¶ø¿ÉÒÔÔÚVxWorksϵͳװ±¸ÉÏÖ´ÐÐí§Òâ´úÂë¡£

µ±Í¨¹ýŲÓÃipdhcpc_if_eventcbº¯Êý¶Ôdhcp¿Í»§¶ËµÄhandle¾ÙÐгõʼ»¯Ê±£¬ipdhcpc_if_eventcbº¯Êý»áŲÓÃipdhcpc_handle_mallocº¯ÊýΪdhcp¿Í»§¶ËµÄhandle·ÖÅɿռ䣬ÔÚipdhcpc_handle_mallocº¯ÊýÖУ¬¸Ãº¯ÊýΪhandle->info.options·ÖÅÉÁ˾ÞϸΪipdhcpc.max_message_size-264×ֽڵĿռ䡣

µ±ipdhcpc_daemonµÄÖ÷Ñ»·ÄÚÖ´ÐÐipcom_recvfromÎüÊÕÏìÓ¦Êý¾Ý°üʱ£º

ipdhcpc_daemonº¯ÊýÎüÊÕºóÊý¾Ýºó£¬»áŲÓÃipdhcpc_reply_inputº¯Êý¶ÔÎüÊÕµ½µÄdhcpÐÒéÊý¾Ý¾ÙÐд¦Öóͷ££¬ÆäÖÐhandle->priv->in_optlen µÄ³¤¶È»ùÓÚipdhcpc.in_pkt_lenÅÌË㣬handle->priv->in_optlen=ipdhcpc.in_pkt_len-240£¬Ò²¾ÍÊÇ˵handle->priv->in_optlenµÄ×î´óֵΪipdhcpc.max_message_size-240¡£

È»ºó£¬ÔÚºóÐøµÄŲÓà ipdhcpc_offer_input£¨»òipdhcpc_ack_input£©£¬ÔÚÕâÁ½¸öº¯ÊýÖлáÖ´ÐÐmemcpy²Ù×÷£º

ÔÚÉÏͼÖУ¬handle-> priv-> in_optlenµÄ×î´óÖµ¿ÉÒÔÊÇipdhcpc.max_message_size - 240£¬Ëü´óÓÚΪhandle-> info.options·ÖÅɵĿռ䣬Ϊipdhcpc.max_message_size - 264¡£ÔÚvxwroksÖÐipdhcpc.max_message_sizeֵĬÒÔΪ576£¬¹¥»÷ÕßÔÚ¾ÖÓòÍøÖÐͨ¹ý½á¹¹³¤¶ÈΪ576µÄ¶ñÒâdhcpÏìÓ¦Êý¾Ý¾Í¿ÉÒÔʹµÃ±»¹¥»÷×°±¸ÖеÄvxworksϵͳ±¬·¢24×ֽڵĶÑÒç³ö¡£
¡ø CVE-2019-12258Îó²îÆÊÎö

Iptcp_inputº¯Êý»áŲÓÃiptcp_process_options()º¯Êý´¦Öóͷ£TCPÍ·µÄoptionsÊý¾ÝÓò¡£Iptcp_process_options()º¯ÊýÔÚÅжÏoptionsÊý¾ÝÓòÀàÐÍʱ£¬ÊµÏÖ´úÂëÈçÏ£º

¸Ãswitchƾ֤optionsÊý¾ÝÓòµÄÀàÐ;ÙÐзַ¢£¬Õâ¸öcase·ÖÖ§ÊÇÉèÖÃMSSµÄ£¬ÐÐ80²¢ÅжϸÃÀàÐ͵ÄoptionsÊý¾ÝÓò³¤¶È±ØÐèΪ4£¬ÈôÊDz»¼´ÊÇ4£¬¾ÍÅжÏMSS²»·¨£¬Ö±½ÓÍ˳ö¡£·µ»Øµ½iptcp_inputº¯ÊýÖУ¬ÓÉÓÚ·µ»ØֵСÓÚ0£¬¾Í½øÈëif·ÖÖ§£¬Å²ÓÃiptcp_send_reset()º¯Êý£¬¸Ãº¯Êý¹¦Ð§ÊÇÖØÖò¢¶ÏµôÄ¿½ñTCPÅþÁ¬¡£ÈôÊǹ¥»÷Õß·¢ËͶñÒâoptionsµÄTCPÊý¾Ý°ü£¬½«µ¼ÖÂÅþÁ¬¶Ï¿ª¡£´ËÎó²î¿ÉÒÔÔÊÐí¹¥»÷ÕßÇ¿ÖÆÖØÖÃÅþÁ¬µ½ÊÜÓ°ÏìµÄVxWorks×°±¸µÄÈκÎTCP»á»°£¬Ôì³É¾Ü¾ø·þÎñ¹¥»÷¡£
? ABB¹«Ë¾¹¤Òµ×Ô¶¯»¯²úÆ·
? ͨÓõçÆø¹¤Òµ×Ô¶¯»¯²úÆ·? °¬Ä¬Éú(Emerson)¹«Ë¾¹¤Òµ¿ØÖÆ×°±¸
? ÈÕÁ¢(HITACHI)¹«Ë¾Ò½ÁÆ×°±¸
? °Ùͨ(Belden)¹¤Òµ×°±¸
? µÂ¶û¸ñ(Dr?ger)¹«Ë¾Ò½ÁÆ×°±¸
? Ê©Ä͵Â(Schneider)¹«Ë¾PLC
? ÈýÁâ(Mitsubishi)¹«Ë¾¹¤Òµ¿ØÖÆÆ÷
? ·ÉÀûÆÖ(Philips)¹«Ë¾Ò½ÁÆ×°±¸
? ¿â¿¨(KUKA)¹«Ë¾¹¤Òµ»úеÈË
? Ê·Ìձȶû(St?ubli)¹«Ë¾¹¤Òµ»úеÈË
? °²´¨(Yaskawa)µç»ú¹¤Òµ»úеÈË
³ýÁËÒÔÉÏ×°±¸£¬ÉÐÓдó×ÚʹÓÃVxWorksµÄ×°±¸£¬ÏêϸÁбíÇë²ÎÕղο¼ÎÄÏ×Á´½Ó1ºÍ2¡£
²Î¿¼ÎÄÏ×£º
2.https://en.wikipedia.org/wiki/VxWorks#Notable_uses
3.https://armis.com/urgent11/
4.https://rockwellautomation.custhelp.com/app/answers/detail/a_id/1088561
5.https://www.sonicwall.com/support/product-notification/?sol_id=190717234810906
6.https://security.business.xerox.com/en-us/
7.https://www.windriver.com/security/announcements/tcp-ip-network-stack-ipnet-urgent11/