# Possible HTTP Parameter Pollution detected

## Overview

* **Rule ID**: `java_lang_http_parameter_pollution`
* **Applicable Languages**: Java
* **Weakness ID**: CWE-88

## Description

Constructing a URL with unsanitized user input can result in HTTP Parameter Pollution (HPP) attacks. In these attacks, an attacker can manipulate the URL or request parameters to modify requests or access concealed information.

## Remediation Guidelines

* **Avoid using** direct or unsanitized user input when constructing URLs or URL parameters.
* **Use** alternative and secure methods to incorporate user input into URLs. For example, a lookup table:

  ```java
  HashMap<String, String> lookupTable = new HashMap<>();
  // ... populate hash map
  String rawUserInput = request.getParameter("someParam");
  String value = lookupTable.getOrDefault(rawUserInput, "someDefault");
  HttpGet httpget = new HttpGet("https://example.com/?param=" + value);
  ```
* **Always sanitize** user input before using it in your URLs to ensure that any harmful characters or attempts to manipulate the URL are neutralized.

## References

* [**CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')**](https://cwe.mitre.org/data/definitions/88.html)
* [**OWASP Top 10: A03:2021 - Injection**](https://owasp.org/Top10/A03_2021-Injection/)

## 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/possible-http-parameter-pollution-detected.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.
