CVE DatabaseCVE-2017-5638
한국어 권고문 →
CVE-2017-56389.8/CRITICALCISA KEVCWE-755CWE-755

Apache Struts 2 Jakarta Multipart Parser Remote Code Execution (RCE) Vulnerability (CVE-2017-5638) Analysis and Mitigation Guide

⚡ Jump to Patch
Affected Vendors
apache
Affected Components
struts
Published Date
2017-03-11
CVSS v3.1
9.8
CRITICAL
EPSS (30d)
100.0%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Web applications built on Apache Struts 2.3.x (before 2.3.32) and 2.5.x (before 2.5.10.1)

Impact

Unauthenticated remote attackers can execute arbitrary OS commands with system privileges via crafted HTTP headers such as Content-Type

Mitigation

Immediately upgrade Apache Struts to a secure version (2.3.32, 2.5.10.1, or higher) and apply WAF rules to block malicious OGNL payloads

Affected Products & Version Scope

Apache Struts versions 2.3.19 through 2.3.31, and 2.5 through 2.5.10

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

The most effective remediation is to upgrade Apache Struts to a non-vulnerable version (2.3.32 or 2.5.10.1 and above). For Maven-based projects, update the dependency in your 'pom.xml' file:

xml
<!-- Example of updating struts2-core dependency in pom.xml -->
<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.5.30</version> <!-- Use the latest secure version -->
</dependency>

2. Temporary Workaround & Hardening Configuration

If an immediate upgrade is not feasible, switch the multipart parser from Jakarta to another implementation (such as 'jakarta-stream') in your 'struts.xml' configuration, or configure your Web Application Firewall (WAF) to block requests containing OGNL patterns in HTTP headers.

xml
<!-- Workaround: Switch multipart parser in struts.xml -->
<struts>
    <constant name='struts.multipart.parser' value='jakarta-stream' />
</struts>

3. Log Audit & IoC Verification Commands

Inspect web server access logs for suspicious strings such as '#cmd=', 'java.lang.ProcessBuilder', or 'ognl' within the Content-Type header to identify potential exploitation attempts.

bash
# Search for malicious OGNL injection patterns in web server access logs
grep -Ei '(#cmd|multipart/form-data.*#|java\.lang\.ProcessBuilder|ognl)' /var/log/nginx/access.log /var/log/apache2/access.log 2>/dev/null
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Cloudflare Enterprise & Pro WAF
Immediately upgrade Apache Struts 2 to the latest secure release and deploy WAF rules to filter malicious OGNL expressions in HTTP headers.

Block Exploits Instantly with Managed Virtual Patching Rules

Can't patch production immediately? Deploy managed WAF rules at the edge to intercept RCE, SQLi, and deserialization payloads before they hit your origin server.

3-min setup · Automated Zero-Day Managed Rules
Practice Exploiting & Patching This Web Vulnerability in an Interactive Lab
Launch Hands-On Security Lab

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2017-5638) exists in the Jakarta Multipart parser, the default file upload handler in the Apache Struts 2 framework. Due to improper exception handling and error-message generation during file upload attempts, Struts attempts to parse and evaluate OGNL (Object-Graph Navigation Language) expressions contained within error messages. This allows user-controlled inputs from HTTP headers (such as Content-Type, Content-Disposition, or Content-Length) to be directly executed by the OGNL engine.

2. Exploitation Mechanics & Attack Scenario

An attacker sends a crafted HTTP request containing a malicious OGNL expression inside the 'Content-Type' header. When the Jakarta Multipart parser encounters an error (e.g., invalid file size or format), it triggers an exception. The framework's 'LocalizedTextUtil.findText' method is then called to process the error message, which inadvertently evaluates the attacker's OGNL payload. By manipulating the '#_memberAccess' object and utilizing 'ProcessBuilder', the attacker bypasses sandbox restrictions to execute arbitrary system commands.

3. Infrastructure & Business Impact

With a CVSS score of 9.8, this vulnerability is highly critical and has been actively exploited in the wild. Successful exploitation grants unauthenticated remote attackers full control over the target server. This can lead to sensitive database exposure, lateral movement within the internal network, deployment of ransomware, and complete compromise of the enterprise infrastructure.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2017-5638)

FAQ

Q1. How critical is CVE-2017-5638 and is it actively exploited in the wild?

CVE-2017-5638 is rated CVSS 9.8 (CRITICAL) with a 30-day EPSS exploitation probability of 100.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2017-5638?

Primary impacted vendors include apache across struts. Scope summary: Apache Struts versions 2.3.19 through 2.3.31, and 2.5 through 2.5.10

Q3. What temporary mitigations or workarounds exist for CVE-2017-5638 before patching?

[Mitigation] Immediately upgrade Apache Struts to a secure version (2.3.32, 2.5.10.1, or higher) and apply WAF rules to block malicious OGNL payloads Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2017-5638

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (apache)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2017-5638 Apache Struts 2 Jakarta Multipart Parser Remote Code Execution (RCE) Vulnerability (CVE-2017-5638) Analysis and Mitigation Guide (CVSS 9.8) - Patch & Workaround | CVE Pulse