Skip to content

GHSA-v8j6-6c2r-r27c CVE-2021-31805

Expression Language Injection in Apache Struts

Critical Maven
Severity
9.8 / 10
Critical · CVSS 3.1
Exploit chance (EPSS)
85.43%
Chance of exploitation in the next 30 days. Higher than 99.72% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Fix
2.5.30
Upgrade org.apache.struts:struts2-core to this version or later

Description

The fix issued for CVE-2020-17530 was incomplete. So from Apache Struts 2.0.0 to 2.5.29, still 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.

Affected versions

Maven

PackageVulnerableFixed in
org.apache.struts:struts2-core
>= 2.0.0, < 2.5.30
2.5.30

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

org.apache.struts:struts2-core Maven → 2.5.30

maven
<dependency><groupId>org.apache.struts</groupId><artifactId>struts2-core</artifactId><version>2.5.30</version></dependency>
gradle
implementation("org.apache.struts:struts2-core:2.5.30")

Severity breakdown

CVSS 3.1 9.8

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Weakness

CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')

The product constructs all or part of an expression language (EL) statement in a framework such as a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.

How to prevent it
  • Architecture and Design: Avoid adding user-controlled data into an expression interpreter when possible.
  • Implementation: If user-controlled data must be added to an expression interpreter, one or more of the following should be performed: Validate that the user input will not evaluate as an expression Encode the user input in a way that ensures it is not evaluated as an expression
  • System Configuration, Operation: The framework or tooling might allow the developer to disable or deactivate the processing of EL expressions, such as setting the isELIgnored attribute for a JSP page to "true".

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-8c6j-ffmf-q6vm
Apache Struts RCE Vulnerability
High Known exploited Also affects org.apache.struts:struts2-core
GHSA-47qp-8v9g-39hp
Code injection in Apache Struts
Critical Known exploited Also affects org.apache.struts:struts2-core
GHSA-4wrr-9h5r-m92w
Apache Struts Remote Java Code Execution
Critical Known exploited Also affects org.apache.struts:struts2-core
CVE-2020-17530
Remote code execution in Apache Struts
Critical Known exploited Also affects org.apache.struts:struts2-core
GHSA-j77q-2qqg-6989
Apache Struts vulnerable to remote arbitrary command execution due to improper input validation
Critical Known exploited Also affects org.apache.struts:struts2-core
CVE-2018-11776
Apache Struts vulnerable to remote command execution (RCE) due to improper input validation
High Known exploited Also affects org.apache.struts:struts2-core
GHSA-qcfc-hmrc-59x7
Apache Struts 2 is Missing XML Validation
High Also affects org.apache.struts:struts2-core
GHSA-rg58-xhh7-mqjw
Apache Struts has a Denial of Service vulnerability
High Also affects org.apache.struts:struts2-core
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor