> For the complete documentation index, see [llms.txt](https://docs.sec1.io/user-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sec1.io/user-docs/4-sast/2-java/possible-http-parameter-pollution-detected.md).

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