# CVE-2018-11776: Apache Struts Remote Code Execution

> Attackers can achieve remote code execution in Apache Struts when alwaysSelectFullNamespace is enabled and specific tag configurations are used.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 3 Nov 2021 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Aug 2018
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-cr6j-3jp9-rw65

## What is CVE-2018-11776?

CVE-2018-11776 is a high-severity code injection vulnerability in Apache Struts, published on 22 Aug 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache Struts versions 2.3 to 2.3.34 and 2.5 to 2.5.16 suffer from possible Remote Code Execution when alwaysSelectFullNamespace is true (either by user or a plugin like Convention Plugin) and then: results are used with no namespace and in same time, its upper package have no or wildcard namespace and similar to results, same possibility when using url tag which doesn't have value and action set and in same time, its upper package have no or wildcard namespace.

## Which versions are affected by CVE-2018-11776?

4 open source packages ship an affected version, including org.apache.struts:struts2-core. It affects 8 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.struts:struts2-core` | Maven | From 2.0.4 | 2.3.35 |
| `org.apache.struts:struts2-core` | Maven | From 2.0.4 | 2.3.35 |
| `org.apache.struts:struts2-core` | Maven | From 2.5 | 2.5.17 |
| `org.apache.struts:struts2-core` | Maven | From 2.5 | 2.5.17 |

Products: Apache Struts, Netapp Active Iq Unified Manager, Netapp Oncommand Insight, Netapp Oncommand Workflow Automation, Netapp Snapcenter, Oracle Communications Policy Management, Oracle Enterprise Manager Base Platform, Oracle Mysql Enterprise Monitor.

## How do I fix CVE-2018-11776?

Upgrade org.apache.struts:struts2-core to a fixed version for your release line: 2.3.35 or 2.5.17. US federal agencies must fix it by 3 May 2022.

## Is CVE-2018-11776 being exploited?

Yes. Attackers have exploited CVE-2018-11776 in the wild since at least 3 Nov 2021.

Public exploit code:

-  An exploit for Apache Struts CVE-2018-11776 (github_poc): https://github.com/mazen160/struts-pwn_CVE-2018-11776
- Working Python test and PoC for CVE-2018-11776, includes Docker lab (github_poc): https://github.com/hook-s3c/CVE-2018-11776-Python-PoC
- This tool takes advantage of CVE-2018-11776 and Shodan to perform mass exploitation of verified and vulnerable Apache Struts servers. (github_poc): https://github.com/649/Apache-Struts-Shodan-Exploit
- Proof of Concept for CVE-2018-11776 (github_poc): https://github.com/Ekultek/Strutter
- Critical Remote Code Execution Vulnerability (CVE-2018-11776) Found in Apache Struts. (github_poc): https://github.com/arlyone/Apache-Struts-0Day-Exploit
- A simple exploit for Apache Struts RCE S2-057 (CVE-2018-11776) (github_poc): https://github.com/brianwrf/S2-057-CVE-2018-11776

## Other vulnerabilities in Apache Struts

- [CVE-2020-17530](https://insights.sbomify.com/CVE-2020-17530/): Apache Struts Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2017-9791](https://insights.sbomify.com/CVE-2017-9791/): Apache Struts 1 Improper Input Validation (critical 9.8, exploited in the wild)
- [CVE-2017-5638](https://insights.sbomify.com/CVE-2017-5638/): Apache Struts Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2012-0391](https://insights.sbomify.com/CVE-2012-0391/): Apache Struts 2 Improper Input Validation (critical 9.8, exploited in the wild)
- [CVE-2017-9805](https://insights.sbomify.com/CVE-2017-9805/): Apache Struts Deserialization of Untrusted Data (high 8.1, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-11776 and fix it if it is affected.

What it is: CVE-2018-11776 is a high-severity code injection vulnerability in Apache Struts, published on 22 Aug 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2018-11776 in the wild since at least 3 Nov 2021.

Affected packages and fixed versions:
- org.apache.struts:struts2-core (Maven): affected from 2.0.4; fixed in 2.3.35
- org.apache.struts:struts2-core (Maven): affected from 2.0.4; fixed in 2.3.35
- org.apache.struts:struts2-core (Maven): affected from 2.5; fixed in 2.5.17
- org.apache.struts:struts2-core (Maven): affected from 2.5; fixed in 2.5.17

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2018-11776/ (Markdown: https://insights.sbomify.com/CVE-2018-11776/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2018-11776
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2018-11776
- OSV: https://osv.dev/vulnerability/CVE-2018-11776

---
From sbomify Insights: https://insights.sbomify.com/CVE-2018-11776/
Summaries are generated and may contain mistakes; the official description above is the record.
