# Usage of vulnerable Apache Commons Collections InvokeTransformer class

## Overview

* **Rule ID**: `java_lang_apache_commons_collection`
* **Applicable Languages**: Java
* **Weakness ID**: CWE-1395

## Description

In versions of Apache Commons Collections older than 3.2.2, the InvokeTransformer class is vulnerable to remote code execution. This vulnerability occurs during data deserialization, allowing malicious actors to execute arbitrary code on the server.

## Risks

* **Remote Code Execution**: Attackers can exploit the vulnerability to execute arbitrary code on the server where the application is running.
* **Server Compromise**: Successful exploitation can lead to full compromise of the server, enabling unauthorized access, data theft, or further attacks.
* **Data Breach**: Access to sensitive data stored on the server or processed by the application.
* **Service Disruption**: Potential for service interruption or downtime resulting from unauthorized code execution.

## Remediation Guidelines

* **Upgrade Apache Commons Collections** to version 3.2.2 or newer to mitigate the vulnerability in the InvokeTransformer class.

  ```java
  <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-collections4</artifactId>
    <version>3.2.2</version>
  </dependency>
  ```

## References

* [**Apache Commons Collections 3.2.2 Security Report**](https://commons.apache.org/proper/commons-collections/security-reports.html)
* [**CWE-1395: Dependency on Vulnerable Third-Party Component**](https://cwe.mitre.org/data/definitions/1395.html)

## Configuration

To omit this rule during a scan, and to provide you with continuous 24/7 code-level scanning, you can employ our [**SAST TOOL**](https://scopy.sec1.io/login)
