¡¾Â©¶´Í¨¸æ¡¿PostgreSQL JDBC Driver SQL×¢Èë©¶´£¨CVE-2022-31197£©
Ðû²¼Ê±¼ä 2022-08-240x00 ©¶´¸ÅÊö
CVE ID | CVE-2022-31197 | ·¢ÏÖʱ¼ä | 2022-08-23 |
Àà ÐÍ | SQL×¢Èë | µÈ ¼¶ | ÖÐΣ |
Ô¶³ÌÀûÓà | ÊÇ | Ó°Ï췶Χ | |
¹¥»÷ÅÓ´ó¶È | ¸ß | Óû§½»»¥ | ÊÇ |
PoC/EXP | ÔÚÒ°ÀûÓÃ |
0x01 ©¶´ÏêÇé
PostgreSQL JDBC Driver£¨¼ò³Æ PGJDBC£©ÊÇÒ»¸öÓà Pure Java£¨Type 4£©±àдµÄ¿ªÔ´JDBCÇý¶¯·¨Ê½£¬ÔÊÐíJava ·¨Ê½Ê¹Óó߶ȵġ¢¶ÀÁ¢ÓÚÊý¾Ý¿âµÄJava´úÂëÁ¬½Óµ½ PostgreSQL Êý¾Ý¿â¡£
8ÔÂ3ÈÕ£¬PGJDBC±»Åû¶´æÔÚÒ»¸öSQL×¢Èë©¶´£¨CVE-2022-31197£©£¬ÆäCVSSÆÀ·ÖΪ5.9¡£
ÓÉÓÚjava.sql.ResultRow.refreshRow()ÒªÁìµÄPGJDBCʵÏÖûÓжÔÁÐÃû½øÐÐתÒ壬Òò´Ëµ±¶ñÒâÁÐÃûÖаüÂÞÓï¾äÖÕÖ¹·û£¬Èç¡°;¡±Ê±ÔÚijЩÇé¿öÏ¿ÉÄܵ¼ÖÂSQL ×¢È룬ÀÖ³ÉÀûÓôË©¶´½«Äܹ»ÒÔÓ¦Ó÷¨Ê½µÄJDBCÓû§Éí·ÝÖ´ÐÐSQL ÃüÁî¡£
Ó°Ï췶Χ
PostgreSQL JDBC Driver < 42.2.26
42.3.0 <= PostgreSQL JDBC Driver < 42.4.1
×¢£º²»µ÷ÓÃResultSet.refreshRow()ÒªÁìµÄÓû§Ó¦Ó÷¨Ê½²»ÊÜÓ°Ïì¡£
0x02 Äþ¾²½¨Òé
Ŀǰ´Ë©¶´ÒѾÐÞ¸´£¬ÊÜÓ°ÏìÓû§¿ÉÉý¼¶µ½PostgreSQL JDBC Driver °æ±¾42.2.26¡¢42.4.1»ò¸ü¸ß°æ±¾¡£
ÏÂÔØÁ´½Ó£º
https://jdbc.postgresql.org/download.html
0x03 ²Î¿¼Á´½Ó
https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-r38f-c4h4-hqq2
https://nvd.nist.gov/vuln/detail/CVE-2022-31197
0x04 °æ±¾ÐÅÏ¢
°æ±¾ | ÈÕÆÚ | ÐÞ¸ÄÄÚÈÝ |
V1.0 | 2022-08-24 | Ê×´ÎÐû²¼ |
0x05 ¸½Â¼
¶¶È¦Îª¶Ä¶øÉú¼ò½é
¶¶È¦Îª¶Ä¶øÉú½¨Á¢ÓÚ1996Ä꣬ÊÇÓÉÁôÃÀ²©Ê¿ÑÏÍû¼ÑŮʿ´´½¨µÄ¡¢ÓµÓÐÍêÈ«×ÔÖ÷֪ʶ²úȨµÄÐÅÏ¢Äþ¾²¸ß¿Æ¼¼ÆóÒµ¡£ÊǹúÄÚ×î¾ßʵÁ¦µÄÐÅÏ¢Äþ¾²²úÎï¡¢Äþ¾²·þÎñ½â¾ö·½°¸µÄÁ캽ÆóÒµÖ®Ò»¡£
¹«Ë¾×ܲ¿Î»ÓÚ±±¾©ÊÐÖйشåÈí¼þÔ°¶¶È¦Îª¶Ä¶øÉú´óÏ㬹«Ë¾Ô±¹¤½ü4000ÈË£¬Ñз¢ÍŶÓ1200ÓàÈË, ¼¼Êõ·þÎñÍŶÓ1300ÓàÈË¡£ÔÚÈ«¹ú¸÷Ê¡¡¢ÊС¢×ÔÖÎÇøÉèÁ¢·ÖÖ§»ú¹¹ÁùÊ®¶à¸ö£¬ÓµÓÐÁýÕÖÈ«¹úµÄÏúÊÛÌåϵ¡¢ÇþµÀÌåϵºÍ¼¼ÊõÖ§³ÖÌåϵ¡£¹«Ë¾ÓÚ2010Äê6ÔÂ23ÈÕÔÚÉîÛÚÖÐС°å¹ÒÅÆÉÏÊС££¨¹ÉƱ´úÂ룺002439£©
¶àÄêÀ´£¬¶¶È¦Îª¶Ä¶øÉúÖÂÁ¦ÓÚÌṩ¾ßÓйú¼Ê¾ºÕùÁ¦µÄ×ÔÖ÷´´ÐµÄÄþ¾²²úÎïºÍ×î¼Ñʵ¼ù·þÎñ£¬×ÊÖú¿Í»§È«ÃæÌáÉýÆäIT»ù´¡ÉèÊ©µÄÄþ¾²ÐÔºÍÉú²úЧÄÜ£¬Îª´òÔìºÍÌáÉý¹ú¼Ê»¯µÄÃñ×åÐÅÏ¢Äþ¾²¹¤ÒµÁì¾üÆ·ÅÆ¶ø²»Ð¸Å¬Á¦¡£
¹ØÓÚ¶¶È¦Îª¶Ä¶øÉú
¶¶È¦Îª¶Ä¶øÉúÄþ¾²Ó¦¼±ÏìÓ¦ÖÐÐÄÖ÷ÒªÕë¶ÔÖØÒªÄþ¾²Â©¶´µÄÔ¤¾¯¡¢¸ú×ٺͷÖÏíÈ«Çò×îеÄÍþвÇ鱨ºÍÄþ¾²³ÂËß¡£
¹Ø×¢ÒÔϹ«Öںţ¬»ñȡȫÇò×îÐÂÄþ¾²×ÊѶ£º