# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sec1.io/user-docs/4-sast/2-java/usage-of-vulnerable-apache-commons-collections-invoketransformer-class.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
