org.apache.struts:struts2-core@2.3.4 vulnerabilities

Direct Vulnerabilities

Known vulnerabilities in the org.apache.struts:struts2-core package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • C
Remote Code Execution (RCE)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Remote Code Execution (RCE) via manipulation of file upload parameters that enable path traversal. Under certain conditions, uploading of a malicious file is possible, which may then be executed on the server.

How to fix Remote Code Execution (RCE)?

Upgrade org.apache.struts:struts2-core to version 2.5.33, 6.3.0.2 or higher.

[,2.5.33) [6.0.0,6.3.0.2)
  • M
Denial of Service

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Denial of Service when certain fields exceed the maxStringLength limit during multipart requests. An attacker can exploit this to leave uploaded files in the struts.multipart.saveDir even after the request has been denied resulting in excessive disk usage.

How to fix Denial of Service?

Upgrade org.apache.struts:struts2-core to version 2.5.32, 6.1.2.2, 6.3.0.1 or higher.

[,2.5.32) [6.0.0,6.1.2.2) [6.2.0,6.3.0.1)
  • M
Allocation of Resources Without Limits or Throttling

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to improper handling of getProperty() by the XWorkListPropertyAccessor class. Exploiting this vulnerability is possible if the developer has set CreateIfNull to true for the underlying Collection type field.

How to fix Allocation of Resources Without Limits or Throttling?

Upgrade org.apache.struts:struts2-core to version 2.5.31, 6.1.2.1 or higher.

[2.0.0,2.5.31) [6.1.2,6.1.2.1)
  • H
Remote Code Execution (RCE)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). The fix issued for CVE-2020-17530 was incomplete. Some of the tag’s attributes could perform a double evaluation if a developer applied forced OGNL evaluation by using the %{...} syntax. Using forced OGNL evaluation on untrusted user input can lead to a Remote Code Execution and security degradation.

How to fix Remote Code Execution (RCE)?

Upgrade org.apache.struts:struts2-core to version 2.5.30 or higher.

[2.0.0,2.5.30)
  • C
Remote Code Execution (RCE)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). The vulnerability exists due to improper input validation when processing certain tag's attributes. The application performs double evaluation of the code if a developer applied forced OGNL evaluation by using the %{...} syntax. A remote attacker can send a specially crafted request to the application and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.

How to fix Remote Code Execution (RCE)?

Upgrade org.apache.struts:struts2-core to version 2.5.26 or higher.

[2.0.0,2.5.26)
  • H
Unrestricted Upload of File with Dangerous Type

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Unrestricted Upload of File with Dangerous Type. A local code execution issue exists in Apache Struts2 when processing malformed XSLT files, which could let a malicious user upload and execute arbitrary files.

How to fix Unrestricted Upload of File with Dangerous Type?

Upgrade org.apache.struts:struts2-core to version 2.5 or higher.

[,2.5)
  • H
Denial of Service (DoS)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Denial of Service (DoS). When a file upload is performed to an Action that exposes the file with a getter, an attacker may manipulate the request such that the working copy of the uploaded file is set to read-only. As a result, subsequent actions on the file will fail with an error. It might also be possible to set the Servlet container's temp directory to read-only, such that subsequent upload actions will fail.

How to fix Denial of Service (DoS)?

Upgrade org.apache.struts:struts2-core to version 2.5.22 or higher.

[2.0.0,2.5.22)
  • C
Remote Code Execution (RCE)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). Forced double OGNL evaluation, when evaluated on raw user input in tag attributes, may lead to remote code execution.

How to fix Remote Code Execution (RCE)?

Upgrade org.apache.struts:struts2-core to version 2.5.22 or higher.

[2.0.0,2.5.22)
  • H
Remote Code Execution

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Remote Code Execution. When the namespace value is not set for a result defined in underlying xml configurations, and in same time, its upper action(s) configurations have no or wildcard namespace, an attacker may be able to conduct a remote code execution attack. They could also use the opportunity when using a url tag which does not have a value and action set and in same time, its upper action(s) configurations have no or wildcard namespace.

How to fix Remote Code Execution?

Upgrade org.apache.struts:struts2-core to version 2.3.35, 2.5.17 or higher.

[2.3.0,2.3.35) [2.5.0,2.5.17)
  • H
Arbitrary Command Execution

Apache Struts2 is a popular open-source framework for developing web applications in the Java programming language.

The REST Plugin in affected versions use a XStreamHandler with an instance of XStream for deserialization without any type filtering. By design, there are few limits to the type of objects XStream can handle. This flexibility comes at a price. The XML generated or consumed by XStream includes all information required to build Java objects of almost any type. The provided XML data is used by XStream to unmarshal Java objects. An attacker could use this flaw to execute arbitrary code or conduct further attacks.

A working exploit is publicly available and is actively exploited in the wild.

You can read more about this vulnerability on our blog.

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502), is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, letting the attacker control the state or the flow of the execution.

Java deserialization issues have been known for years. However, interest in the issue intensified greatly in 2015, when classes that could be abused to achieve remote code execution were found in a popular library (Apache Commons Collection). These classes were used in zero-days affecting IBM WebSphere, Oracle WebLogic and many other products.

An attacker just needs to identify a piece of software that has both a vulnerable class on its path, and performs deserialization on untrusted data. Then all they need to do is send the payload into the deserializer, getting the command executed.

Developers put too much trust in Java Object Serialization. Some even de-serialize objects pre-authentication. When deserializing an Object in Java you typically cast it to an expected type, and therefore Java's strict type system will ensure you only get valid object trees. Unfortunately, by the time the type checking happens, platform code has already created and executed significant logic. So, before the final type is checked a lot of code is executed from the readObject() methods of various objects, all of which is out of the developer's control. By combining the readObject() methods of various classes which are available on the classpath of the vulnerable application an attacker can execute functions (including calling Runtime.exec() to execute local OS commands).

  • Apache Blog

How to fix Arbitrary Command Execution?

Developers are strongly advised to upgrade their Apache Struts components to version 2.3.34, 2.5.13 or higher.

It is possible that some REST actions stop working because of applied default restrictions on available classes. In this case please investigate the new interfaces that were introduced to allow class restrictions per action, those interfaces are:

  • org.apache.struts2.rest.handler.AllowedClasses
  • org.apache.struts2.rest.handler.AllowedClassNames
  • org.apache.struts2.rest.handler.XStreamPermissionProvider

If for some reason upgrading is not an option, consider the following workarounds:

  1. Disable handling XML pages and requests to such pages
<constant name="struts.action.extension" value="xhtml,,json" />
  1. Override getContentType in XStreamHandler
 public class MyXStreamHandler extends XStreamHandler { 
   public String getContentType() {
     return "not-existing-content-type-@;/&%$#@";
   }
 }
  1. Register the handler by overriding the one provided by the framework in your struts.xml
<bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="myXStreamHandmer" class="com.company.MyXStreamHandler"/>
<constant name="struts.rest.handlerOverride.xml" value="myXStreamHandler"/>

[,2.3.34) [2.4,2.5.13)
  • C
Arbitrary Code Execution

Apache Struts2 is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to arbitrary code execution. Using expression literals or forcing expressions in Freemarker tags (see example snippet below), and using request values can lead to remote code execution.

<@s.hidden name="redirectUri" value=redirectUri />
<@s.hidden name="redirectUri" value="${redirectUri}" />
<@s.hidden name="${redirectUri}"/>

In both cases a writable property is used in the value attribute and in both cases this is treated as an expression by Freemarker. Please be aware that using Struts expression evaluation style is safe:

<@s.hidden name="redirectUri" value="%{redirectUri}" />
<@s.hidden name="%{redirectUri}"/>

How to fix Arbitrary Code Execution?

Developers are strongly advised to upgrade their Apache Struts components to version 2.3.34, 2.5.12 or higher.

[,2.3.34) [2.4,2.5.12)
  • C
Improper Action Name Cleanup

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Improper Action Name Cleanup. It allowed attackers to have unspecified impact via vectors related to improper action name clean up.

How to fix Improper Action Name Cleanup?

Upgrade org.apache.struts:struts2-core to version 2.3.29, 2.5.1 or higher.

[2.0.0,2.3.29) [2.5,2.5.1)
  • C
Arbitrary Command Execution

org.apache.struts:struts2-core Apache Struts 2.3.20.x before 2.3.20.3, 2.3.24.x before 2.3.24.3, and 2.3.28.x before 2.3.28.1, when Dynamic Method Invocation is enabled, allow remote attackers to execute arbitrary code via vectors related to an ! (exclamation mark) operator to the REST Plugin.

[2,2.3.20.2) [2.3.24,2.3.24.3) [2.3.28,2.3.28.1)
  • H
Command Injection

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Command Injection. When Dynamic Method Invocation was enabled, a remote attackers could execute arbitrary code via the prefix method, related to chained expressions.

How to fix Command Injection?

Upgrade org.apache.struts:struts2-core to version 2.3.20.2, 2.3.24.2, 2.3.28.1 or higher.

[2.0.0,2.3.20.2) [2.3.24,2.3.24.2) [2.3.28,2.3.28.1)
  • C
Arbitrary Code Execution

org.apache.struts:struts2-core is a free open-source solution for creating Java web applications.

Affected versions of this package are vulnerable to Arbitrary Code Execution. It allows remote attackers to execute arbitrary code via the stylesheet location parameter.

How to fix Arbitrary Code Execution?

Upgrade org.apache.struts:struts2-core to version 2.3.20.2, 2.3.24.2, 2.3.28.1 or higher.

[2,2.3.20.2) [2.3.24,2.3.24.2) [2.3.28,2.3.28.1)
  • M
Cross-site Scripting (XSS)

org.apache.struts:struts2-core Cross-site Scripting (XSS) vulnerability in the URLDecoder function in JRE before 1.8, as used in Apache Struts 2.x before 2.3.28, when using a single byte page encoding, allows remote attackers to inject arbitrary web script or HTML via multi-byte characters in a url-encoded parameter.

[,2.3.28)
  • L
Cross-site Scripting (XSS)

org.apache.struts:struts2-core Affected versions of the package are vulnerable to Cross-site Scripting (XSS) when debug mode is switched on or JSPs are exposed in production environment.

[2,2.3.20)
  • M
Cross-site Scripting (XSS)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS). When debug mode is turned on, under certain conditions an arbitrary script may be executed in the 'Problem Report' screen. Also if JSP files are exposed to be accessed directly it's possible to execute an arbitrary script.

How to fix Cross-site Scripting (XSS)?

Upgrade org.apache.struts:struts2-core to version 2.3.20 or higher.

[2.0.0,2.3.20)
  • H
Manipulation of Struts' internals

ValueStack defines special top object which represents root of execution context. It can be used to manipulate Struts' internals or can be used to affect container's settings.

[2.0.0,2.3.24.1)
  • M
Cross-site Request Forgery (CSRF)

It uses predictable <s:token/> values, which allows remote attackers to bypass the CSRF protection mechanism.

[2.0.0,2.3.20)
  • H
Arbitrary Code Execution

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Arbitrary Code Execution. It allows remote attackers to execute arbitrary OGNL code via a request with a crafted value that contains both "${}" and "%{}" sequences, which causes the OGNL code to be evaluated twice.

How to fix Arbitrary Code Execution?

Upgrade org.apache.struts:struts2-core to version 2.3.14.3 or higher.

[2.0.0,2.3.14.3)
  • M
Classloader manipulation via CookieInterceptor

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Classloader manipulation via CookieInterceptor. When a wildcard cookiesName value is used, CookieInterceptor does not properly restrict access to the getClass method, which allows remote attackers to "manipulate" the ClassLoader and modify session state via a crafted request. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-0113.

How to fix Classloader manipulation via CookieInterceptor?

Upgrade org.apache.struts:struts2-core to version 2.3.20 or higher.

[2.0.0,2.3.20)
  • H
Arbitrary Code Execution

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Arbitrary Code Execution. When a wildcard cookiesName value is used, CookieInterceptor does not properly restrict access to the getClass method, which allows remote attackers to "manipulate" the ClassLoader and execute arbitrary code via a crafted request. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-0094.

How to fix Arbitrary Code Execution?

Upgrade org.apache.struts:struts2-core to version 2.3.16.2 or higher.

[2.0.0,2.3.16.2)
  • M
ClassLoader Manipulation via ParametersInterceptor

org.apache.struts:struts2-core The ParametersInterceptor in Apache Struts before 2.3.16.1 allows remote attackers to "manipulate" the ClassLoader via the class parameter, which is passed to the getClass method.

[2,2.3.16.1)
  • M
Bypass Access Controls

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Bypass Access Controls. It allows remote attackers to bypass access controls via a crafted action: prefix.

How to fix Bypass Access Controls?

Upgrade org.apache.struts:struts2-core to version 2.3.15.3 or higher.

[2.0.0,2.3.15.3)
  • C
Dynamic Method Executions

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Dynamic Method Executions. It enables Dynamic Method Invocation by default, which has unknown impact and attack vectors.

How to fix Dynamic Method Executions?

Upgrade org.apache.struts:struts2-core to version 2.3.15.2 or higher.

[2.0.0,2.3.15.2)
  • H
Remote Command Execution

org.apache.struts:struts2-core Apache Struts 2.0.0 through 2.3.15 allows remote attackers to execute arbitrary OGNL expressions via a parameter with a crafted (1) action:, (2) redirect:, or (3) redirectAction: prefix.

[2,2.3.15)
  • M
URL Redirection to Untrusted Site

org.apache.struts:struts2-core Multiple open redirect vulnerabilities in Apache Struts 2.0.0 through 2.3.15 allow remote attackers to redirect users to arbitrary web sites and conduct phishing attacks via a URL in a parameter using the (1) redirect: or (2) redirectAction: prefix.

[2.0.0,2.3.15)
  • H
Arbitrary Code Injection

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Arbitrary Code Injection. It allows remote attackers to execute arbitrary OGNL code via a request with a crafted action name that is not properly handled during wildcard matching, a different vulnerability than CVE-2013-2135.

How to fix Arbitrary Code Injection?

Upgrade org.apache.struts:struts2-core to version 2.3.14.3 or higher.

[2.0.0,2.3.14.3)
  • H
Arbitrary Code Injection

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Arbitrary Code Injection. Apache Struts 2 before 2.3.14.2 allows remote attackers to execute arbitrary OGNL code via a crafted request that is not properly handled when using the includeParams attribute in the (1) URL or (2) A tag. NOTE: this issue is due to an incomplete fix for CVE-2013-1966.

How to fix Arbitrary Code Injection?

Upgrade org.apache.struts:struts2-core to version 2.3.14.2 or higher.

[2,2.3.14.2)
  • H
Arbitrary Code Injection

org.apache.struts:struts2-core Apache Struts 2 before 2.3.14.1 allows remote attackers to execute arbitrary OGNL code via a crafted request that is not properly handled when using the includeParams attribute in the (1) URL or (2) A tag.

[2,2.3.14.1)
  • H
Arbitrary Code Injection

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Arbitrary Code Injection. It allows remote attackers to execute arbitrary OGNL code via a crafted parameter name that is not properly handled when invoking a redirect.

How to fix Arbitrary Code Injection?

Upgrade org.apache.struts:struts2-core to version 2.3.14.1 or higher.

[2.0.0,2.3.14.1)
  • M
Cross-site Request Forgery (CSRF)

org.apache.struts:struts2-core is a popular open-source framework for developing web applications in the Java programming language.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF). The token check mechanism does not properly validate the token name configuration parameter, which allows remote attackers to perform cross-site request forgery (CSRF) attacks by setting the token name configuration parameter to a session attribute.

How to fix Cross-site Request Forgery (CSRF)?

Upgrade org.apache.struts:struts2-core to version 2.3.4.1 or higher.

[2.0.0,2.3.4.1)