cve.bz

CVE-2021-31805 apache struts: Expression Language Injection

9.8 criticalEPSS 85%Fix available

Critical (9.8) in apache struts. EPSS 85% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.struts:struts2-core 2.5.30.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
85% (unchanged from 85% a week ago; 85% 30 days ago) estimated probability of exploitation activity in the next 30 days; 100th percentile. Scored 2026-11-24. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-31805 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-31805?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-31805?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-31805 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
apache:strutsfrom 2.0.0 through 2.5.29

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-v8j6-6c2r-r27cMavenorg.apache.struts:struts2-core>=2.0.0 <2.5.302.5.30

Red Hat

Red Hat rates this Important.

Red Hat's statement

Apache Struts2 is not compiled, shipped, used, or enabled in Red Hat products. As such, any CVE against Apache Struts2 does not impact currently supported Red Hat products.

This statement was last revised on 1 Sept 2020.

Previous statement example: https://bugzilla.redhat.com/show_bug.cgi?id=1469265

ProductPackageStateAdvisory
Red Hat JBoss Fuse 6strutsNot affected
Red Hat JBoss Fuse Service Works 6strutsNot affected
Red Hat JBoss Operations Network 3strutsNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-31805.

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

References

Check your stackJSON