Remote code execution via double-evaluated OGNL input
Published Apr 12, 2022 · Updated Aug 3, 2024
Expression language injection in Apache Struts 2.0.0 through 2.5.29 allows remote attackers to execute arbitrary code via crafted input. Affected tag attributes evaluate forced %{...} OGNL syntax, then treat the resulting untrusted string as a second OGNL expression. A Struts application is exposed only when its developer applies forced OGNL evaluation to a tag attribute fed by raw, unvalidated user input; successful exploitation runs code in the application process.
Summary
What happened
Expression language injection in Apache Struts 2.0.0 through 2.5.29 allows remote attackers to execute arbitrary code via crafted input. Affected tag attributes evaluate forced %{...} OGNL syntax, then treat the resulting untrusted string as a second OGNL expression. A Struts application is exposed only when its developer applies forced OGNL evaluation to a tag attribute fed by raw, unvalidated user input; successful exploitation runs code in the application process.
The record
- CVE
- CVE-2021-31805
- Published
- Apr 12, 2022
- Updated
- Aug 3, 2024
- Vendor
- The Apache Software Foundation
- Product
- Apache Struts
- Classifications
- CWE-917, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Apr 12, 2022CVE publishedPublication date reported by the CVE source.
- Aug 3, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=2.0.0 to 2.5.29
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Struts2 S2-062 command-execution scriptsfunctional · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo