¡¾Îó²îͨ¸æ¡¿FreeBSD OpenSSHÔ¶³Ì´úÂëÖ´ÐÐÎó²î£¨CVE-2024-7589£©

Ðû²¼Ê±¼ä 2024-08-12


Ò»¡¢Îó²î¸ÅÊö

Îó²îÃû³Æ

 FreeBSD OpenSSHÔ¶³Ì´úÂëÖ´ÐÐÎó²î

CVE   ID

CVE-2024-7589

Îó²îÀàÐÍ

¾ºÕùÌõ¼þ

·¢Ã÷ʱ¼ä

2024-08-12

Îó²îÆÀ·Ö

8.1

Îó²îÆ·¼¶

¸ßΣ

¹¥»÷ÏòÁ¿

ÍøÂç

ËùÐèȨÏÞ

ÎÞ

ʹÓÃÄѶÈ

¸ß

Óû§½»»¥

ÎÞ

PoC/EXP

δ¹ûÕæ

ÔÚҰʹÓÃ

δ·¢Ã÷

 

OpenSSHÊÇSSH£¨Secure SHell£©Ð­ÒéµÄ¿ªÔ´ÊµÏÖ £¬Ëüͨ¹ý²»Çå¾²µÄÍøÂçÔÚÁ½¸ö²»ÊÜÐÅÍеÄÖ÷»úÖ®¼äÌṩÇå¾²µÄ¼ÓÃÜͨѶ¡£OpenSSH ÆÕ±éÓÃÓÚ»ùÓÚUnix µÄϵͳ£¨°üÀ¨FreeBSD£© £¬Í¨³£ÓÃÓÚÇå¾²Ô¶³ÌµÇ¼ºÍÔ¶³ÌÎļþ´«Êä £¬ÒÔ¼°ÆäËüÍøÂç·þÎñ¡£

2024Äê8ÔÂ12ÈÕ £¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø¼¯ÍÅVSRC¼à²âµ½FreeBSD OpenSSHÖб£´æÒ»¸öÔ¶³Ì´úÂëÖ´ÐÐÎó²î£¨CVE-2024-7589£© £¬¸ÃÎó²îÓëCVE-2024-6387ÀàËÆ £¬²¢Ó°ÏìÁËËùÓÐÊÜÖ§³ÖµÄ FreeBSD °æ±¾¡£

FreeBSD OpenSSHÖб£´æÐźŴ¦Öóͷ£³ÌÐò¾ºÕùÌõ¼þÎó²î £¬ÈôÊÇSSH¿Í»§¶ËδÔÚÉ趨µÄLoginGraceTime ÃëÄÚ£¨Ä¬ÒÔΪ120 Ã룩¾ÙÐÐÉí·ÝÑéÖ¤ £¬½«Å²ÓÃÐźŴ¦Öóͷ£³ÌÐò£¨ÔÚsshd(8) µÄÌØȨ´úÂëÉÏÏÂÎÄÖÐÖ´ÐÐ £¬Î´¾­É³ºÐ´¦Öóͷ£²¢ÒÔrootȨÏÞÔËÐУ© £¬µ«¸ÃÐźŴ¦Öóͷ£³ÌÐò¿ÉÄÜ»áŲÓ÷ÇÒì²½ÐźÅÇå¾²£¨async-signal-safe£©µÄÈÕÖ¾¼Í¼º¯Êý £¬¿ÉÄܵ¼Ö¾ºÕùÌõ¼þ £¬ÍþвÕß¿ÉʹÓøÃÎó²îÒÔroot Éí·ÝʵÏÖδ¾­Éí·ÝÑéÖ¤µÄÔ¶³Ì´úÂëÖ´ÐС£


¶þ¡¢Ó°Ïì¹æÄ£

¸ÃÎó²îÓ°ÏìËùÓÐÖ§³ÖµÄFreeBSDϵͳ°æ±¾É쵀 OpenSSH£º

STABLE-14<= FreeBSD < 14.1-STABLE

14.1-RELEASE <= FreeBSD < 14.1-RELEASE-p3

14.0-RELEASE <= FreeBSD < 14.0-RELEASE-p9

STABLE-13<= FreeBSD < 13.3-STABLE

13.3-RELEASE <= FreeBSD < 13.3-RELEASE-p5

 

Èý¡¢Çå¾²²½·¥

3.1 Éý¼¶°æ±¾

ÏÖÔÚ¸ÃÎó²îÒÑÐÞ¸´ £¬ÊÜÓ°ÏìÓû§¿ÉÉý¼¶µ½ÒÔÏÂFreeBSDÎȹ̰æ»òÐû²¼/Çå¾²·ÖÖ§ (releng)°æ±¾ £¬È»ºóÖØÐÂÆô¶¯ssh·þÎñ£º

FreeBSD stable 14£ºÉý¼¶µ½14.1-STABLE

FreeBSD releng 14.1£ºÉý¼¶µ½14.1-RELEASE-p3

FreeBSD releng 14.0£ºÉý¼¶µ½14.0-RELEASE-p9

FreeBSD stable 13£ºÉý¼¶µ½13.3-STABLE

FreeBSD releng 13.3£ºÉý¼¶µ½13.3-RELEASE-p5

ÏÂÔØÁ´½Ó£º

https://www.freebsd.org/where/

3.2 ÔÝʱ²½·¥

»º½â£º

ÈôÊÇÎÞ·¨¸üРsshd(8) £¬Ôò¿ÉÒÔͨ¹ýÔÚ /etc/ssh/sshd_config Öн« LoginGraceTime ÉèÖÃΪ 0 ²¢ÖØÐÂÆô¶¯ssh·þÎñÀ´»º½â¸ÃÎó²î £¬Õâ»áºÄ¾¡ËùÓÐ MaxStartups ÅþÁ¬ £¬´Ó¶øʹsshd ÈÝÒ×Êܵ½¾Ü¾ø·þÎñ¹¥»÷ £¬µ«¿ÉÒÔ»º½â¸ÃRCEΣº¦¡£

²¹¶¡£º

Ö´ÐÐÒÔϲÙ×÷Ö®Ò»ºó £¬ÖØÐÂÆô¶¯ÊØ»¤³ÌÐò»òϵͳ¡£

1..ͨ¹ý¶þ½øÖƲ¹¶¡¸üÐÂÒ×Êܹ¥»÷µÄϵͳ¡£ÔÚ amd64 »ò arm64 ƽ̨ÉÏÔËÐÐ FreeBSD RELEASE°æ±¾µÄϵͳ £¬»òÔÚ FreeBSD 13 É쵀 i386 ƽ̨ÉÏÔËÐеÄϵͳ¿ÉÒÔͨ¹ý freebsd-update(8)ÊÊÓóÌÐò¾ÙÐиüУº

# freebsd-update fetch

# freebsd-update install2

2.ͨ¹ýÔ´´úÂë²¹¶¡¸üÐÂÒ×Êܹ¥»÷µÄϵͳ¡£ÏÂÔØÏà¹Ø²¹¶¡ £¬È»ºóʹÓà PGP ÊÊÓóÌÐòÑéÖ¤ÊèÉ¢µÄ PGP ÊðÃû¡£

# fetch https://security.FreeBSD.org/patches/SA-24:08/openssh.patch

# fetch https://security.FreeBSD.org/patches/SA-24:08/openssh.patch.asc

# gpg --verify openssh.patch.asc

Ó¦Óò¹¶¡¡£ÒÔ root Éí·ÝÖ´ÐÐÒÔÏÂÏÂÁ

# cd /usr/src

# patch < /path/to/patch

3. ʹÓà buildworld ºÍ installworld ÖØбàÒë²Ù×÷ϵͳ £¬¿É²Î¿¼£º

https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld

3.3 ͨÓý¨Òé

l  °´ÆÚ¸üÐÂϵͳ²¹¶¡ £¬ïÔ̭ϵͳÎó²î £¬ÌáÉý·þÎñÆ÷µÄÇå¾²ÐÔ¡£

l  ÔöǿϵͳºÍÍøÂçµÄ»á¼û¿ØÖÆ £¬Ð޸ķÀ»ðǽսÂÔ £¬¹Ø±Õ·ÇÐëÒªµÄÓ¦Óö˿ڻò·þÎñ £¬ïÔÌ­½«Î£ÏÕ·þÎñ£¨ÈçSSH¡¢RDPµÈ£©Ì»Â¶µ½¹«Íø £¬ïÔÌ­¹¥»÷Ãæ¡£

l  ʹÓÃÆóÒµ¼¶Çå¾²²úÆ· £¬ÌáÉýÆóÒµµÄÍøÂçÇå¾²ÐÔÄÜ¡£

l  ÔöǿϵͳÓû§ºÍȨÏÞÖÎÀí £¬ÆôÓöàÒòËØÈÏÖ¤»úÖƺÍ×îСȨÏÞÔ­Ôò £¬Óû§ºÍÈí¼þȨÏÞÓ¦¼á³ÖÔÚ×îµÍÏ޶ȡ£

l  ÆôÓÃÇ¿ÃÜÂëÕ½ÂÔ²¢ÉèÖÃΪ°´ÆÚÐ޸ġ£

3.4 ²Î¿¼Á´½Ó

https://www.freebsd.org/security/advisories/FreeBSD-SA-24:08.openssh.asc

https://www.cve.org/CVERecord?id=CVE-2024-7589

 

ËÄ¡¢°æ±¾ÐÅÏ¢

°æ±¾

ÈÕÆÚ

±¸×¢

V1.0

2024-08-12

Ê×´ÎÐû²¼

 

 

Îå¡¢¸½Â¼

5.1 ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø¼ò½é

ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø½¨ÉèÓÚ1996Äê £¬ÊÇÓÉÁôÃÀ²©Ê¿ÑÏÍû¼ÑŮʿ½¨ÉèµÄ¡¢ÓµÓÐÍêÈ«×ÔÖ÷֪ʶ²úȨµÄÐÅÏ¢Çå¾²¸ß¿Æ¼¼ÆóÒµ¡£ÊǺ£ÄÚ×î¾ßʵÁ¦µÄÐÅÏ¢Çå¾²²úÆ·¡¢Çå¾²·þÎñ½â¾ö¼Æ»®µÄÁ캽ÆóÒµÖ®Ò»¡£

¹«Ë¾×ܲ¿Î»ÓÚ±±¾©ÊÐÖйشåÈí¼þÔ°ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø´óÏà £¬¹«Ë¾Ô±¹¤6000ÓàÈË £¬Ñз¢ÍŶÓ1200ÓàÈË, ÊÖÒÕ·þÎñÍŶÓ1300ÓàÈË¡£ÔÚÌìϸ÷Ê¡¡¢ÊС¢×ÔÖÎÇøÉèÁ¢·ÖÖ§»ú¹¹ÁùÊ®¶à¸ö £¬ÓµÓÐÁýÕÖÌìϵÄÏúÊÛϵͳ¡¢ÇþµÀϵͳºÍÊÖÒÕÖ§³Öϵͳ¡£¹«Ë¾ÓÚ2010Äê6ÔÂ23ÈÕÔÚÉîÛÚÖÐС°å¹ÒÅÆÉÏÊС££¨¹ÉƱ´úÂ룺002439£©

¶àÄêÀ´ £¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÖÂÁ¦ÓÚÌṩ¾ßÓйú¼Ê¾ºÕùÁ¦µÄ×ÔÖ÷Á¢ÒìµÄÇå¾²²úÆ·ºÍ×î¼Ñʵ¼ù·þÎñ £¬×ÊÖú¿Í»§ÖÜÈ«ÌáÉýÆäIT»ù´¡ÉèÊ©µÄÇå¾²ÐÔºÍÉú²úЧÄÜ £¬Îª´òÔìºÍÌáÉý¹ú¼Ê»¯µÄÃñ×åÐÅÏ¢Çå¾²¹¤ÒµÁì¾üÆ·Åƶø²»Ð¸Æ𾢡£

5.2 ¹ØÓÚÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍø

ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøÇå¾²Ó¦¼±ÏìÓ¦ÖÐÐÄÒÑÐû²¼1000¶à¸öÎó²îͨ¸æºÍΣº¦Ô¤¾¯ £¬ÎÒÃǽ«Ò»Á¬¸ú×ÙÈ«Çò×îеÄÍøÂçÇå¾²ÊÂÎñºÍÎó²î £¬ÎªÆóÒµµÄÐÅÏ¢Çå¾²±£¼Ý»¤º½¡£

¹Ø×¢ÎÒÃÇ£º

image.png