ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab£ºVxWorks¶à¸öÔ¶³ÌÎó²îÆÊÎö

Ðû²¼Ê±¼ä 2019-08-02
? Îó²îÅä¾°

VxWorksÊÇÌìÏÂÉÏʹÓÃ×îÆÕ±éµÄʵʱ²Ù×÷ϵͳ£¨RTOS£©£¬ÓÐÁè¼Ý20ÒŲ́װ±¸ÕýÔÚʹÓ㬰üÀ¨¹¤Òµ¡¢µçÁ¦¡¢ÄÜÔ´£¬º½¿Õº½ÌìµÈÐÐÒµÒªº¦»ù´¡ÉèÊ© ¡£


¿ËÈÕ£¬ArmisÑо¿ÍŶÓArmis LabsÔÚVxWorksÖз¢Ã÷ÁË11¸ö0dayÎó²î±»³ÆΪURGENT/11£¬ÆäÖÐ6¸öÎó²îΪÑÏÖØÎó²î²¢¿ÉÒÔÔ¶³ÌÖ´ÐдúÂ루RCE£©£¬ÆäÓà5¸öÎó²î°üÀ¨¾Ü¾ø·þÎñ¡¢ÐÅϢй¶ºÍÂß¼­È±ÏÝÎó²î ¡£ÕâЩÎó²îÄܹ»Ê¹¹¥»÷ÕßÔ¶³Ì½ÓÊÜ×°±¸£¬¶øÎÞÐè½»»¥£¬ÉõÖÁ¿ÉÒÔÈƹý·À»ðǽµÈÖܱßÇå¾²×°±¸ ¡£ÕâЩÌØÕ÷ʹÕâЩÎó²î¡°Ò×ÓÚʹÓá±£¬ÕâÒâζ×ÅËüÃÇ¿ÉÓÃÓÚ½«¶ñÒâÈí¼þÈö²¥µ½ÍøÂçÄÚ²¿£¬ÕâÖÖ¹¥»÷¾ßÓкܴóµÄDZÁ¦£¬ÀàËÆÓÚWannaCry¶ñÒâÈí¼þµÄÈö²¥·½·¨£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÇ¿ÁÒ½¨ÒéÏà¹ØÓû§¾¡¿ì¾ÙÐÐ×°±¸°æ±¾Éý¼¶²¢×öºÃÍøÂçÇå¾²×°±¸µÄ¹æÔòÉý¼¶ÊÂÇé ¡£

? Îó²îÓ°Ïì°æ±¾


URGENT/11Îó²îÓ°Ïì×Ô6.5°æÒÔÀ´µÄÏÕЩËùÓÐVxWorks°æ±¾£¬²»°üÀ¨ÎªÈÏÖ¤¶øÉè¼ÆµÄ²úÆ·°æ±¾£¬ÀýÈçVxWorks 653ºÍVxWorks Cert Edition ¡£


? VxWorks7(SR540ºÍSR610)
? VxWorks6.5~6.9.4
? ʹÓÃIPNetÍøÂçЭÒéÕ»µÄVxWorks°æ±¾

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
±í1 Îó²îÓ°ÏìÁбí

? ½â¾ö¼Æ»®

? ·À»ðǽºÍIDS²úÆ·Ìí¼Ó¹æÔò£¬¼ì²âÒì³£Á÷Á¿ ¡£
? ʹÓÃ×îÐÂÎó²îɨÃ蹤¾ß¼ì²âÄÚ²¿ÊÜÎó²îÓ°ÏìµÄ×°±¸×ʲú ¡£
? ·çºÓ(Wind River)¹«Ë¾ÒÑÐû²¼Ïà¹Ø°æ±¾¸üкͲ¹¶¡ÐÅÏ¢ ¡£
? ÂÞ¿ËΤ¶û(Rockwell)¡¢Sonicwall¡¢Ê©ÀÖ(Xerox)µÈ¹«Ë¾ÒÑÐû²¼¸üаü£¬Çëʵʱ¸üР¡£

? Îó²îÔ­ÀíÆÊÎö

Armis LabsÔÚVxWorksÖй²·¢Ã÷ÁË11¸ö0dayÎó²î£¬ÆäÖÐ6¸öÎó²îΪÑÏÖØÎó²î²¢¿ÉÒÔÔ¶³ÌÖ´ÐдúÂ루RCE£©£¬ÆäÓà5¸öÎó²îΪ¾Ü¾ø·þÎñ£¬ÐÅϢ鶻òÂß¼­È±ÏÝÎó²î ¡£ÏêϸÈçϱíËùʾ£º

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
±í2 Îó²îÐÎòÁбí


ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø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°æ±¾ÖУ¬ÊµÏÖ´úÂëÈçÏÂËùʾ£º

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ1 iptcp_deliverÖÐÉèÖÃurg_ptrµÄ´úÂë


ÔÚÒÔºósocketÖ´ÐÐrecv£¨£©²Ù×÷ʱ£¬»áŲÓú¯Êýiptcp_usr_get_from_recv_queue£¬¸Ãº¯Êý´¦Öóͷ£±¨ÎĶÎʱÊ×ÏÈÅжÏÄ¿½ñTCPÊý¾Ý¶ÎÊÇ·ñ°üÀ¨urgent±ê¼Ç£¬ÈôÊÇ°üÀ¨¸Ã±ê¼Ç£¬Ôò¼ì²éÊÇ·ñ»á½«Ä¿½ñTCP´°¿ÚÖеÄurgent Êý¾Ý¶ÁÈ¡³öÀ´£¨urgentÊý¾Ý²»ÔÊÐíͨ¹ýͨÀýrecv¶ÁÈ ¡£© ¡£¼ì²é·½·¨ÈçÏÂͼËùʾ£º


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ2 ¼ì²é¶ÁÈ¡Êý¾ÝÊÇ·ñ»á°üÀ¨urgent data


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


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ3 recvÇëÇóµÄÊý¾ÝÇøÓò£¨ÈªÔ´£ºURGENT/11ÊÖÒÕ°×ƤÊ飩

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ4 ÖØÐÂÐÞÕýlenÖ®ºórecv¶ÁÈ¡µÄÊý¾ÝÇøÓò£¨ÈªÔ´£ºURGENT/11ÊÖÒÕ°×ƤÊ飩


ÈôÊÇÎüÊÕµ½µÄTCP¶ÎÖеÄurgent_pointer×Ö¶ÎÉèÖÃΪ0£¬Ôòiptcp_usr_get_from_recv_queueͨ¹ýÅÌËã»ñµÃÐÞÕýºóµÄlenΪ-1 ¡£ÓÉÓÚlenÊÇÎÞ·ûºÅÕûÊý£¬¼´¼´ÊÇ0xffffffff ¡£Õâµ¼ÖÂrecv£¨£©Å²ÓÃÖÐÉèÖõĶÁÈ¡³¤¶ÈÏÞÖÆʧЧ£¬´Ó¶ø¿½±´ËùÓпɶÁÈ¡µÄÊý¾Ýµ½Óû§»º³åÇø£¬Ôì³ÉÒç³ö ¡£


Îó²îÑéÖ¤£º


¸ÃÎó²îÓ°ÏìµÄ°æ±¾°üÀ¨VxWorks6.5µ½VxWorks 6.9.3 ¡£
ƾ֤Îó²îÔ­Àí£¬ÎÒÃDZàдÁ˸ÃÎó²îµÄPOCÑéÖ¤³ÌÐò£¬²¢ÔÚVxWorks6.8°æ±¾µÄϵͳÉϾÙÐÐÁËÑéÖ¤ ¡£Í¨¹ýÖ±½Ó·¢ËÍurgent pointerΪ0µÄÊý¾Ý°ü£¬Ôì³ÉÕ»Òç³öºóÁýÕÖº¯Êý·µ»ØµØµã£¬ÈçÏÂͼËùʾ£º

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ5 CVE-2019-12255Îó²îÑéÖ¤

¡ø CVE-2019-12257Îó²îÆÊÎö


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


ipdhcpcÊØ»¤Àú³ÌÆô¶¯ºó»á½øÈëipdhcpc_daemonº¯Êý¾ÙÐÐÍøÂçÊý¾ÝµÄÑ­»·¼àÌý£¬ipdhcpc_daemonº¯ÊýÖ÷ÒªÁ÷³ÌÓÐÈý²½£¬µÚÒ»²½ÊÇͨ¹ýŲÓÃipdhcpc_if_eventcbº¯Êý¶ÔDHCP¿Í»§¶ËµÄhandle¾ÙÐгõʼ»¯²¢·¢ËÍDHCP¹ã²¥ÇëÇ󣬵ڶþ²½ÊÇŲÓÃipcom_recvfromÎüÊÕDHCP·þÎñÆ÷»Ø¸´µÄÏìÓ¦Êý¾Ý°ü£¬µÚÈý²½ÊÇͨ¹ýŲÓÃipdhcpc_replay_input¶ÔÎüÊÕµ½µÄÏìÓ¦Êý¾Ý°ü¾ÙÐд¦Öóͷ£ ¡£

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ6 ipdhcpc_daemonº¯ÊýÁ÷³ÌʾÒâ


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


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ7 ipdhcpc_handle_mallocº¯ÊýÁ÷³ÌʾÒâ


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


´Ë´¦ÎüÊÕ×î¶àΪipdhcpc.max_message_size×Ö½ÚµÄÊý¾Ý°ü£¬ipdhcpc.in_pkt_lenµÄ×î´ó³¤¶ÈΪipdhcpc.max_message_size ¡£

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ8 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 ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ9 ipdhcpc_reply_inputº¯ÊýŲÓÃʾÒâ


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


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ10 ipdhcpc_reply_inputÁ÷³ÌʾÒâ


ÔÚÉÏͼÖУ¬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Îó²îÆÊÎö


CVE-2019-12255Îó²îÊÇIPNetЭÒéÕ»ÔÚ´¦Öóͷ£TCP±¨ÎÄ·ÖƬʱµÄ¾Ü¾ø·þÎñÎó²î ¡£ÔÚÊÜÓ°ÏìµÄVxWorksϵͳÖÐIptcp_inputº¯ÊýÓÃÓÚ´¦Öóͷ£TCP·ÖƬµÄÊý¾Ý°ü£¬ÔÚÆÊÎöTCPͷʱ£¬ÊµÏÖ´úÂëÈçÏ£º

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ11 Iptcp_inputº¯ÊýʾÒâ


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


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢
ͼ12 Iptcp_process_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 ¡£


²Î¿¼ÎÄÏ×£º


1.https://www.windriver.com/customers/
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/