{"id":227378,"date":"2020-03-10T12:47:14","date_gmt":"2020-03-10T19:47:14","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=227378"},"modified":"2020-03-11T13:11:17","modified_gmt":"2020-03-11T20:11:17","slug":"addressing-ghostcat-on-azure","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/addressing-ghostcat-on-azure\/","title":{"rendered":"Addressing the Apache Tomcat &#8220;Ghostcat&#8221; vulnerability on Azure"},"content":{"rendered":"<p>A security vulnerability, <a href=\"https:\/\/www.zdnet.com\/article\/ghostcat-bug-impacts-all-apache-tomcat-versions-released-in-the-last-13-years\/\">Ghostcat<\/a>, was announced on Friday, February 28<sup>th<\/sup> affecting all Apache Tomcat versions. Ghostcat exploits the Apache Jserv Protocol connector to read and write files to a Apache Tomcat server. <a href=\"https:\/\/tomcat.apache.org\/security-7.html#Fixed_in_Apache_Tomcat_7.0.100\">The Apache Tomcat security release<\/a> states \u201c[the] mitigation is only required if an AJP port is accessible to untrusted users.\u201d Please follow the instructions below to assess and address your vulnerability.<\/p>\n<h3>App Service<\/h3>\n<p>The AJP connector is disabled on all Apache Tomcat installations on both App Service Linux and Windows. If you have not edited the server.xml, then your Apache Tomcat application is not vulnerable.<\/p>\n<p>If you have edited your server.xml, follow these instructions to address your vulnerability:<\/p>\n<ol>\n<li>Search your server.xml for the following XML tag:<\/li>\n<\/ol>\n<p class=\"\" style=\"text-align: center;\"><span style=\"font-family: 'courier new', courier, monospace;\">&lt;Connector port=&#8221;8009&#8243; protocol=&#8221;AJP\/1.3&#8243; redirectPort=&#8221;8443&#8243; \/&gt;<\/span><\/p>\n<ol start=\"2\">\n<li>If the line is commented out or cannot be found, then your Apache Tomcat application is not vulnerable.<\/li>\n<li>If the line exists and is not commented out, then your Apache Tomcat application is vulnerable. Comment out the line as shown below. Save the file and restart your App Service.<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><span style=\"font-family: 'courier new', courier, monospace;\">&lt;!&#8211; &lt;Connector port=&#8221;8009&#8243; protocol=&#8221;AJP\/1.3&#8243; redirectPort=&#8221;8443&#8243; \/&gt; &#8211;&gt;<\/span><\/p>\n<p>We encourage customers to update their Apache Tomcat versions using the Azure Portal or CLI when the patched versions are available. The patched versions will be available in May.<\/p>\n<h3>Azure Kubernetes Service, Container Instances, Webapps for Containers, and Virtual Machines<\/h3>\n<p>By default, the AJP connector is enabled on all Apache Tomcat versions. You should immediately update your Apache Tomcat installation to the latest patch versions. The patch versions for Apache Tomcat 7, 8, and 9 are below. There is no patch provided for Apache Tomcat 6 as it reached End-of-Life in 2016<\/p>\n<ul>\n<li><a href=\"https:\/\/tomcat.apache.org\/security-7.html#Fixed_in_Apache_Tomcat_7.0.100\">Apache Tomcat 7.0.100<\/a><\/li>\n<li><a href=\"https:\/\/tomcat.apache.org\/security-8.html#Fixed_in_Apache_Tomcat_8.5.51\">Apache Tomcat 8.5.51<\/a><\/li>\n<li><a href=\"https:\/\/tomcat.apache.org\/security-9.html#Fixed_in_Apache_Tomcat_9.0.31\">Apache Tomcat 9.0.31<\/a><\/li>\n<\/ul>\n<p>If you cannot immediately update your Apache Tomcat version, follow these instructions to mitigate the vulnerability.<\/p>\n<ol>\n<li>Connect to your VM or container via SSH or a similar protocol<\/li>\n<li>Navigate to your Apache Tomcat\u2019s server.xml file. This is usally under <span style=\"font-family: 'courier new', courier, monospace;\">$TOMCAT_HOME\/conf<\/span><\/li>\n<li>Find the XML tag that enables the AJP connector. The default value is below:<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><span style=\"font-family: 'courier new', courier, monospace;\">&lt;Connector port=&#8221;8009&#8243; protocol=&#8221;AJP\/1.3&#8243; redirectPort=&#8221;8443&#8243; \/&gt;<\/span><\/p>\n<ol start=\"4\">\n<li>Delete or comment this line<\/li>\n<li>Save server.xml<\/li>\n<li>Restart Apache Tomcat<\/li>\n<\/ol>\n<h3>Spring Boot Users<\/h3>\n<p>The default embedded web server for Spring Boot is Apache Tomcat. By default, Spring Boot does not declare an AJP connector. Your Spring Boot applications are not vulnerable unless you explicitly enabled the AJP connector in your configuration<\/p>\n<h4>More Information<\/h4>\n<ul>\n<li><a href=\"http:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2020-1938\">CVE-2020-1938<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How to address the Ghostcat vulnerability on Azure<\/p>\n","protected":false},"author":20976,"featured_media":227205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-227378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"blog_post_summary":"<p>How to address the Ghostcat vulnerability on Azure<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/227378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/20976"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=227378"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/227378\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/227205"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=227378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=227378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=227378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}