CVE-2016-1182: Improper Input Validation in Apache Struts

Summary

13/05/2022
No i
High
8.2

CVE-2016-1182: Improper Input Validation in Apache Struts. Affects org.apache.struts:struts-core versions < 1.3.10. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apache Struts is an open-source framework for developing Java web applications. It provides a set of reusable components and a MVC (Model-View-Controller) architecture for building scalable and maintainable web applications. The vulnerability identified as CVE-2016-1182 affects Apache Struts versions 1.x through 1.3.10. This vulnerability arises due to improper input validation in the ActionServlet.java file, which fails to properly restrict the Validator configuration. As a result, remote attackers can exploit this vulnerability to conduct cross-site scripting (XSS) attacks or cause a denial of service by submitting crafted input. This vulnerability is similar to CVE-2015-0899.

Vulnerability Detail

The vulnerability in Apache Struts allows remote attackers to exploit the application by submitting malicious input. This can lead to cross-site scripting (XSS) attacks, where the attacker injects malicious scripts into web pages viewed by other users. Additionally, the vulnerability can be used to cause a denial of service, potentially disrupting the availability of the affected application. The vulnerability is rated as HIGH severity with a CVSS score of 8.2. It is classified under CWE-20, which refers to improper input validation.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If upgrading to a non-affected version of Apache Struts is not immediately feasible, a possible workaround is to implement custom input validation and output encoding mechanisms to mitigate the risk of XSS attacks. This can involve validating and sanitizing user input before using it in dynamic web content and applying appropriate encoding techniques to prevent script injection. Here is an example of how input validation and output encoding can be implemented in Java:

// Input validation

String userInput =

request.getParameter("input");

if (userInput != null) {
  // Sanitize input

String sanitizedInput = userInput.replaceAll("<", "<").replaceAll(">", ">");

  // Use sanitized input in dynamic content
  response.getWriter().println("Hello " + sanitizedInput);
}

// Output encoding

String userContent = "<script>

alert('XSS');

</script>"; String encodedContent =

ESAPI.encoder().encodeForHTML(userContent);

response.getWriter().println(encodedContent);

Conclusion

The vulnerability in Apache Struts, identified as CVE-2016-1182, allows remote attackers to conduct cross-site scripting attacks or cause a denial of service. It is important to upgrade to a non-affected version of Apache Struts and follow proper input validation and output encoding practices to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.struts:struts-core →

Share this vulnerability

FAQ

Apache Struts is an open-source framework for developing Java web applications. It provides a set of reusable components and a MVC architecture for building scalable and maintainable web applications.

The vulnerability allows remote attackers to conduct cross-site scripting (XSS) attacks or cause a denial of service by submitting crafted input. This can lead to the injection of malicious scripts into web pages viewed by other users or disrupt the availability of the affected application.

To fix this vulnerability, it is recommended to upgrade to a version of Apache Struts that is not affected by this issue. Upgrading to a version higher than 1.3.10 would address the vulnerability. It is also important to follow proper input validation and output encoding practices in the application.

If upgrading to a non-affected version of Apache Struts is not immediately feasible, a possible workaround is to implement custom input validation and output encoding mechanisms to mitigate the risk of XSS attacks. This involves validating and sanitizing user input before using it in dynamic web content and applying appropriate encoding techniques.

The CVSS score of this vulnerability is 8.2, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.struts:struts-core.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback