Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

Protecting Your Sites from Apache.Commons Vulnerabilities

Overview

A few weeks ago, FoxGlove Security released this important blog post that includes several Proof-of-Concepts for exploiting Java unserialized vulnerabilities.

A remote attacker can gain Remote Code Execution by sending a specially crafted payload to any endpoint expecting a serialized Java object. In some cases, the attack may be executed from an unauthorized and unauthenticated host. Apache Foundation released this detailed description.

 

Which common application servers are vulnerable?

FoxGlove provides POC for attacks on the following servers:

  • WebSphere Application Server - CVE-2015-7450
  • Oracle WebLogic - CVE 2015-4852
  • JBoss Application Server - CVE-2015-7501
  • Jenkins CI - Continuous Integration and DevOps platform
  • OpenNMS - Open Source Network Management Software

As these are application frameworks, URLs are vulnerable depending on actual implementation. However, there are common endpoints that may be exposed. In JBOSS, invoker/JMXInvokerServlet may be exposed, which is a bad idea but not uncommon.

 

Which other applications are at risk?

Any custom Java application server that receives Java Serialized Objects and uses the Apache.Common.Collections library. For example, Legacy web applications developed with the JSF (Java Server Faces) Library. However, this vulnerability can possibly be exploited in Java applications which do not use Apache.Common.Collections. As quoted in the Apache Foundation blog:

"In these rather unfortunate situations, people have looked at the sample exploits. Frohoff provided "gadget chains" in sample payloads which combine classes from the Groovy runtime, Spring framework, or Apache Commons Collection. It is quite certain that you can combine more classes to exploit this weakness, but those are the chains readily available to attackers today."

We might be facing an evolving threat, based on using "gadget chains" from additional libraries. A recent update here lists possible vulnerabilities in many other libraries. This includes some common libraries: JSF 2.2, JasperReports, Apache Hadoop, OpenJPA, Apache Jena, Mule, Hadoop MapReduce, HBase and several others.

 

Known publicly available exploits

For JBoss Application Server - CVE-2015-7501 - there is already a publicly available exploit. There is also a publicly available Java tool that builds a payload to execute any command, as well as a public listing of vulnerable servers as detected by Shodan.

 

General Guidelines for mitigation

  • For In-House Java Applications, Update Apache commons-collection.
  • For the top known vulnerable apps listed in the FoxGlove post, apply vendor fixes as they become available.

 

Guidelines for ModSecurity supported customers

You can write a SecRule to protect known endpoints that receive Java Serialized Objects. For example, to protect endpoint "invoker/JmxInvoker, the rule could be written as follows:

SecRule REQUEST_LINE "@contains /invoker/JmxInvoker" "chain,phase:2,block,t:none,t:urlDecodeUni,capture, /

logdata:'%{matched_var}',severity:'9',id:999999,msg:'Apache-Commons', tag:'Apache-commons'"

SecRule REQUEST_BODY "@pmFromFile java_servuln.data"...

The relevant transformation should be used based on the location. For example, use  t:base64Decode when required. Java_servuln.data should include the following strings:

org/​apache/​commons/​collections/​Transformer

org.​apache.​commons.​collections.​Transformer

org.​apache.​commons.​collections.​functors.​InvokerTransformer

org/​apache/​commons/​collections4/​functors/​InvokerTransformer

org.​apache.​commons.​collections4.​functors.​InvokerTransformer

org/​codehaus/​groovy/​runtime/​ConvertedClosure

org.​codehaus.​groovy.​runtime.​ConvertedClosure

com/​sun/​org/​apache/​xalan/​internal/​xsltc/​trax/​TemplatesImpl

com.​sun.​org.​apache.​xalan.​internal.​xsltc.​trax.​TemplatesImpl

In practice, it is difficult to determine which URIs to protect. We recommend customers perform an architecture review to determine where Java Serialization is used, and perform some profiling for known good data sent to these URIs, to avoid False Positives. Note that as stated in the "Which other applications are at risk?" section, it is impossible to cover all possible cases as additional libraries may be vulnerable.

 

Additional detail - How to mitigate Oracle Weblogic 0-day CVE-2015-4852?

We have also received questions regarding this CVE. This relates to JAVA RMI (Remote Method Invocation) used by Oracle WebLogic for Java-To-Java communication (including with admin console) over T3 binary protocol, port 7001. The best mitigation is to block access to 7001 port on this server from external networks or unknown IP addresses. The method depends on the customer architecture, and can be achieved by either configuring your firewall or other networking equipment with proper access control rules. Users of Weblogic can read up on the configuration for their environment over in this blog post.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo