A vulnerability in the Apache Commons Text being dubbed “Text4Shell” could lead to long term security issues, but not to the extent of Log4Shell, researchers said.

CVE-2022-42889 is a vulnerability in the Apache Commons Text library that can result in code execution when processing malicious input. It affects Apache Commons Text versions 1.5 through 1.9. It has been patched as of Commons Text version 1.10.

The vulnerability became public October 13 on the Apache dev list and was discovered and reported by GitHub Security Lab (GHSL) team member Alvaro Munoz. CVE-2022-42889 is the result of an insecure implementation of Commons Text’s variable interpolation functionality where default lookup strings could potentially accept untrusted input from remote attackers, such as DNS requests, URLs, or inline scripts.

The StringSubstitutor when used with the default interpolators (StringSubstitutor.createInterpolator()) will perform string lookups that may lead to arbitrary code execution, according to a post from Munoz.

In particular, if untrusted data flows into the StringSubstitutor.replace() or StringSubstitutor.replaceIn() methods, an attacker will be able to use the ScriptStringLookup to trigger arbitrary code execution, according to the post. This issue may lead to Remote Code Execution (RCE), Munoz said in the post.

Schneider Bold

Click here for more details on Munoz’ post.

The vulnerability has been compared to Log4Shell since it is an open-source library-level vulnerability that is likely to impact a wide variety of software applications that use the relevant object, said researchers at Rapid7 in a post.

However, initial analysis found the nature of the vulnerability means that unlike Log4Shell, it will be rare that an application uses the vulnerable component of Commons Text to process untrusted, potentially malicious input.

Much like with Spring4Shell, there are significant caveats to practical exploitability for CVE-2022-42889. With that said, Rapid7 researchers recommended patching any relevant impacted software according to your normal, hair-not-on-fire patch cycle.

Pin It on Pinterest

Share This