Cloudanix VulnDB

CVE-2017-12611

Critical · 9.8

CVSS

9.8

EPSS

87.1%

Published

Sep 20, 2017

CISA due date

—

Cloudanix analysis

Act now SSVC: Attend

A long-standing flaw in a popular web framework lets attackers remotely take over servers by slipping harmful instructions into ordinary web requests.

Weaponized
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Remote Code Execution
Component
Web Framework
Class
Improper Input Validation
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

The flaw permits remote attackers to inject and evaluate arbitrary OGNL expressions through Freemarker template tags that were intended to use only string literals, resulting in full remote code execution on the server.

Why it matters to the business

Attackers can take complete control of affected web applications, leading to theft of sensitive data, deployment of ransomware or malware, and disruption of business operations; the vulnerability has been weaponized for years and remains a high-value target for opportunistic and targeted attacks.

How an attack unfolds

An attacker crafts a malicious HTTP request containing specially formatted parameters that reach a Freemarker tag in a Struts application; the tag unintentionally evaluates the input as an expression rather than treating it as a literal string, allowing the attacker to execute arbitrary Java code on the server.

How to fix it

Upgrade Apache Struts to a version that corrects the Freemarker expression handling; remove or restrict any remaining affected installations; apply web-application firewall rules that block common expression-injection patterns while patches are applied.

How to confirm the fix worked

Review application dependency manifests and server startup logs to confirm the Struts version in use; test sample requests with benign expressions to verify that only literal strings are rendered; re-scan after upgrades to ensure the vulnerable code paths are no longer present.

Typical attack path

  1. Identify a Struts-based web application reachable over the network
  2. Craft and send an HTTP request containing an expression payload in a parameter processed by a Freemarker tag
  3. Trigger evaluation of the injected expression to execute operating-system commands or upload further payloads
  4. Establish persistence, exfiltrate data, or pivot within the environment

How to detect it

Examine web-server access logs for requests containing OGNL expression syntax such as %{...} or #this constructs directed at Struts endpoints; review application logs for unexpected Freemarker evaluation errors or class-loading activity; correlate with outbound connections or new processes spawned by the application server.

  • %{#this
  • %{new java.lang
  • freemarker.core.Expression
  • ognl.OgnlException

What your security team should do

  • Immediately inventory all deployments of Apache Struts and prioritize upgrades for internet-facing instances
  • Block or tightly restrict direct exposure of any remaining Struts 2.3.x or 2.5.x applications
  • Enable request logging and anomaly detection for parameters containing OGNL-like syntax
  • Conduct a post-remediation scan to confirm no residual vulnerable versions remain in the environment

The record

In Apache Struts 2.0.0 through 2.3.33 and 2.5 through 2.5.10.1, using an unintentional expression in a Freemarker tag instead of string literals can lead to a RCE attack.

Affected packages

Ecosystem Package Introduced Fixed
Maven org.apache.struts:struts2-core 2.0.1 2.3.34
Maven org.apache.struts:struts2-core 2.5.0 2.5.11
maven org.apache.struts/struts2-core 2.0.1 No fix
maven org.apache.struts/struts2-core 2.0.12 No fix
maven org.apache.struts/struts2-core 2.1.0 No fix
maven org.apache.struts/struts2-core 2.1.8 No fix
maven org.apache.struts/struts2-core 2.2.1 No fix
maven org.apache.struts/struts2-core 2.2.3 No fix
maven org.apache.struts/struts2-core 2.3.1 No fix
maven org.apache.struts/struts2-core 2.3.15 No fix
maven org.apache.struts/struts2-core 2.3.16 No fix
maven org.apache.struts/struts2-core 2.3.17 No fix
maven org.apache.struts/struts2-core 2.3.19 No fix
maven org.apache.struts/struts2-core 2.3.21 No fix
maven org.apache.struts/struts2-core 2.3.24.2 No fix
maven org.apache.struts/struts2-core 2.3.25 No fix
maven org.apache.struts/struts2-core 2.3.29 No fix
maven org.apache.struts/struts2-core 2.3.3 No fix
maven org.apache.struts/struts2-core 2.3.5 No fix
maven org.apache.struts/struts2-core 2.5 No fix

Related vulnerabilities