Apache Commons Configuration performs variable interpolation, allowing properties to be dynamically evaluated and expanded. The standard formatfor interpolation is "${prefix:name}", where "prefix" is used to locate an instance of org.apache.commons.configuration2.interpol.Lookup that performs the interpolation. Starting withversion2.4and continuing through 2.7, thesetof default Lookup instances included interpolators that could resultin arbitrary code execution or contact with remote servers. These lookups are: - "script" - execute expressions usingthe JVM script execution engine (javax.script) - "dns" - resolve dns records - "url" - load values from urls, including from remote servers
Applications usingthe interpolation defaults inthe affected versions may be vulnerable to remote code execution or unintentional contact with remote servers if untrusted configuration values are used.
if (spec == null) { thrownewIllegalArgumentException( "InterpolatorSpecification must not be null!"); } return spec.getInterpolator() != null ? spec.getInterpolator() : createInterpolator(spec);