{"id":465053,"date":"2022-10-18T12:24:11","date_gmt":"2022-10-18T10:24:11","guid":{"rendered":"https:\/\/mybroadband.co.za\/news\/?p=465053"},"modified":"2022-10-18T12:29:05","modified_gmt":"2022-10-18T10:29:05","slug":"major-apache-commons-text-vulnerability-discovered","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/security\/465053-major-apache-commons-text-vulnerability-discovered.html","title":{"rendered":"Major Apache Commons Text vulnerability discovered"},"content":{"rendered":"<p>A dangerous vulnerability related to reckless string interpolation behaviour has been found in the Java source code library Apache Commons Text, Sophos <strong><a href=\"https:\/\/nakedsecurity.sophos.com\/2022\/10\/18\/dangerous-hole-in-apache-commons-text-like-log4shell-all-over-again\/\" target=\"_blank\" rel=\"noopener\">reports<\/a><\/strong>.<\/p>\n<p>The flaw is tracked as CVE-2022-42889 and affects Apache Commons Text versions released before 1.10.0, allowing remote code execution when applied to untrusted input due to insecure interpolation defaults.<\/p>\n<p>The vulnerability affects the StringSubstitutor component of the Common Text Toolkit. The component allows input data to be rewritten once an interpolator has been created.<\/p>\n<p>Sophos provided an example of the kind of data that can be derived directly from the source code StingSubstitutor.java file.<\/p>\n<blockquote>\n<pre>Programming function   Example\r\n--------------------   ----------------------------------\r\nBase64 Decoder:        ${base64Decoder:SGVsbG9Xb3JsZCE=}\r\nBase64 Encoder:        ${base64Encoder:HelloWorld!}\r\nJava Constant:         ${const:java.awt.event.KeyEvent.VK_ESCAPE}\r\nDate:                  ${date:yyyy-MM-dd}  \r\nDNS:                   ${dns:address|apache.org}\r\nEnvironment Variable:  ${env:USERNAME}\r\nFile Content:          ${file:UTF-8:src\/test\/resources\/document.properties}\r\nJava:                  ${java:version} \r\nScript:                ${script:javascript:3 + 4} \r\nURL Content (HTTP):    ${url:UTF-8:http:\/\/www.apache.org}\r\nURL Content (HTTPS):   ${url:UTF-8:https:\/\/www.apache.org}\r\n<\/pre>\n<\/blockquote>\n<p>The DNS, Script, and URL functions are dangerous as they could lead to data from outside a trusted network which is then processed or logged on a business logic server within your network.<\/p>\n<p>For the DNS function, attackers can use a domain name they own and control. The lookup will then be terminated at a DNS of their choosing.<\/p>\n<p>Sophos explained that the URL function looks up a server name, connects to it using HTTP or HTTPS, and then uses what&#8217;s sent back instead of the ${&#8230;} string.<\/p>\n<p>&#8220;The danger posed by this behaviour depends on what the replacement string is used for,&#8221; it added.<\/p>\n<p>The script function is potentially the most dangerous as it allows an attacker to run a command of their choosing. However, Sophos noted that it could only get the function to work on older versions of Java.<\/p>\n<p>To protect networks from vulnerability, Sophos recommends taking the following steps:<\/p>\n<ul>\n<li>Update to Commons Text 1.10.0;<\/li>\n<li>Sanitise your inputs; and<\/li>\n<li>Search your network for Commons Text software that you didn&#8217;t know you had.<\/li>\n<\/ul>\n<hr \/>\n<h3 class=\"my-4\">Now read: <a href=\"https:\/\/mybroadband.co.za\/news\/security\/464845-microsoft-365-uses-weak-encryption-that-exposes-emails-to-snooping.html\" rel=\"bookmark\">Microsoft 365 uses weak encryption that exposes emails to snooping<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Networks can be protected from the flaw by updating to Commons Text 1.10.0, sanitising inputs, and searching<br \/>\nfor Common Text software of which you were unaware.<\/p>\n","protected":false},"author":341076,"featured_media":465061,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[24470,82043,10582,3372,75906,15511],"class_list":["post-465053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","tag-apache","tag-apache-commons-text","tag-java","tag-oracle","tag-remote-code-execution-rce","tag-security-flaw"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/465053"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/341076"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=465053"}],"version-history":[{"count":1,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/465053\/revisions"}],"predecessor-version":[{"id":465095,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/465053\/revisions\/465095"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/465061"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=465053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=465053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=465053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}