Apache TomcatÎļþ°üÀ¨Îó²îÆÊÎö
Ðû²¼Ê±¼ä 2020-02-21Ò»¡¢Îó²î¸ÅÊö
2020Äê2ÔÂ20ÈÕ£¬¹ú¼ÒÐÅÏ¢Çå¾²Îó²î¹²Ïíƽ̨£¨CNVD£©Ðû²¼¹ØÓÚApache TomcatµÄÇ徲ͨ¸æ£¬Apache TomcatÎļþ°üÀ¨Îó²î£¨CNVD-2020-10487£¬¶ÔÓ¦CVE-2020-1938£©¡£Tomcat AJPÐÒéÓÉÓÚ±£´æʵÏÖȱÏݵ¼ÖÂÏà¹Ø²ÎÊý¿É¿Ø£¬¹¥»÷ÕßʹÓøÃÎó²î¿Éͨ¹ý½á¹¹Ìض¨²ÎÊý£¬¶ÁÈ¡·þÎñÆ÷webappϵÄí§ÒâÎļþ¡£Èô·þÎñÆ÷¶Ëͬʱ±£´æÎļþÉÏ´«¹¦Ð§£¬¹¥»÷Õ߿ɽøÒ»²½ÊµÏÖÔ¶³Ì´úÂëµÄÖ´ÐС£
¶þ¡¢Îó²îÆÊÎö
ͨ¹ý¶ÔApache TomcatÔ´Âë¾ÙÐÐÆÊÎö£¬·¢Ã÷TomcatÔÚ´¦Öóͷ£ajpÐÒéʱ±£´æÎó²î£¬¿Éͨ¹ýŲÓÃrequest.setAttributeΪTomcatÉèÖÃí§ÒârequestÊôÐÔ£¬ÈçÏÂͼËùʾ£º
̫ͨ¹ýÎö¸´ÏÖ·¢Ã÷Tomcat ajpÐÒé±£´æwebĿ¼ÏÂí§ÒâÎļþ¶ÁÈ¡Îó²îÒÔ¼°JSPÎļþ°üÀ¨Îó²î¡£µ±ajp URIÉèÖÃΪ·Çjsp·¾¶Ê±£¬Tomcat»áŲÓÃDefaultServlet´¦Öóͷ££¬´Ëʱ»áµ¼ÖÂwebĿ¼í§ÒâÎļþ¶ÁÈ¡Îó²î¡£µ±ajp URIÉèÖÃΪjsp·¾¶Ê±£¬Tomcat»áŲÓÃJspServlet´¦Öóͷ££¬´Ëʱ»áµ¼ÖÂJSPÎļþ°üÀ¨Îó²î¡£
2.1 WebĿ¼í§ÒâÎļþ¶ÁÈ¡Îó²î
µ±ajp URIÉèÖÃΪ·Çjsp·¾¶Ê±£¬Tomcat»áŲÓÃDefaultServlet´¦Öóͷ£,ÎÒÃÇÐèÒª¿ØÖÆÈçÏÂÁ½¸öÊôÐÔ£º
javax.servlet.include.path_info
javax.servlet.include.servlet_path
ÆäÖУ¬javax.servlet.include.servlet_pathÊôÐÔΪĿ½ñÏîĿ·¾¶¡¢javax.servlet.include.path_infoÊôÐÔΪĿ¼·¾¶¡£È»ºó£¬Í¨¹ýDefaultServletÀàµÄgetRelativePathÒªÁì¾ÙÐÐÆ´½Ó»ñµÃpath·¾¶¡£ÈçÏÂͼËùʾ£º
×îºó£¬»á½«path´øÈëµ½getResource(path)ÒªÁìÖÐÔì³Éí§ÒâÎļþ¶ÁÈ¡¡£ÈçÏÂͼËùʾ£º
ʹÓøÃÎó²îÀֳɶÁÈ¡µ½/WEB-INF/Ŀ¼ÏÂweb.xmlÎļþ¡£
2.2 JspÎļþ°üÀ¨Îó²î
µ±ajp URIÉèÖÃΪjsp·¾¶Ê±£¬Tomcat»áŲÓÃJspServletµÄserviceÒªÁì´¦Öóͷ££¬ÈçÏÂͼËùʾ£º
ͬÑù»á»ñÈ¡javax.servlet.include.path_info¡¢javax.servlet.include.servlet_pathÕâÁ½¸öÊôÐÔ£¨¾ÓÉÉÏÃæµÄÆÊÎöÎÒÃÇÒѾ֪µÀ¿ÉÒÔͨ¹ýajpÐÒé¿ØÖÆÕâÁ½¸öÊôÐÔ£©¡£½«ÕâÁ½¸öÊôÐÔ¶ÔÓ¦µÄֵƴ½Óµ½jspURi±äÁ¿ÖУ¬×îºó½»¸øserviceJspFileÒªÁì´¦Öóͷ££¬ÈçÏÂͼËùʾ£º
Venus.txtÎļþ´úÂëÈçÏÂËùʾ£º
ÀÖ³ÉRCEЧ¹ûÈçÏÂͼËùʾ£º
Èý¡¢Ó°Ïì°æ±¾
Tomcat 6
Tomcat 7
Tomcat 8
Tomcat 9
ËÄ¡¢¹æ±Ü¼Æ»®
½«TomcatÁ¬Ã¦Éý¼¶µ½9.0.31¡¢8.5.51»ò7.0.100°æ±¾¾ÙÐÐÐÞ¸´¡£
½ûÓÃAJPÐÒé¡£
±à¼ /conf/server.xml£¬ÕÒµ½ÈçÏÂÐУº
<Connector port="8009"protocol="AJP/1.3" redirectPort="8443" />
½«´ËÐÐ×¢Ê͵ô£¨Ò²¿Éɾµô¸ÃÐУ©£º
<!--<Connectorport="8009" protocol="AJP/1.3"redirectPort="8443" />-->
ÉèÖÃsecretÀ´ÉèÖÃAJPÐÒéµÄÈÏ֤ƾ֤¡£
ÀýÈ磨עÖرØÐ轫YOUR_TOMCAT_AJP_SECRET¸ü¸ÄΪһ¸öÇå¾²ÐԸߡ¢ÎÞ·¨±»ÈÝÒײ½âµÄÖµ£©£º
<Connector port="8009"protocol="AJP/1.3" redirectPort="8443"address="YOUR_TOMCAT_IP_ADDRESS" secret="YOUR_TOMCAT_AJP_SECRET"/>