Bug 1489478 (CVE-2017-12611) - CVE-2017-12611 struts: RCE attack when using an unintentional expression in Freemarker tag instead of string literals
Summary: CVE-2017-12611 struts: RCE attack when using an unintentional expression in F...
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2017-12611
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1489481
TreeView+ depends on / blocked
 
Reported: 2017-09-07 14:20 UTC by Adam Mariš
Modified: 2021-02-17 01:36 UTC (History)
28 users (show)

Fixed In Version: struts 2.3.34, struts 2.5.12
Doc Type: If docs needed, set a value
Doc Text:
It was found that Freemarker in Struts would permit using read-only properties in value assignment of tag expressions. An attacker could use this to execute arbitrary code.
Clone Of:
Environment:
Last Closed: 2017-11-30 20:52:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Adam Mariš 2017-09-07 14:20:19 UTC
When using expression literals or forcing expression in Freemarker tags (see example below) and using request values, it can lead to RCE attack.

<@s.hidden name="redirectUri" value=redirectUri />
<@s.hidden name="redirectUri" value="${redirectUri}" />

In both cases a writable property is used in the value attribute and in both cases this is threatened as an expression by Freemarker.

Affected versions: Struts 2.0.1 - Struts 2.3.33, Struts 2.5 - Struts 2.5.10

External References:

https://struts.apache.org/docs/s2-053.html

Comment 3 Chess Hazlett 2019-09-17 19:57:32 UTC
Statement:

A previous statement by Red Hat related to this CVE, prior to August 2019, said that Apache Struts 2 is not included in any Red Hat products. This earlier statement was incorrect. While Struts 2 is not actively compiled, shipped, used, or enabled in any Red Hat provided final products, and does not cause any vulnerability in the product, struts2-core jars have been included in some products' source code packages. The inclusion was part of an import of the Google Guice repository, which includes struts2-core. Customers that build artefacts from our source code could be at risk. Red Hat will remove these artefacts from source code in future releases.

The products that included the Struts 2 artefacts in their source jars:
Fuse Service Works 6.0.0
Single Sign On 7.3.0+

If you have used the source package from one of these products to build artefacts on your system, you should do the following to remove potentially affected jars:
1. Run 'find . -name struts2*.jar' under the source location
2. Remove any files found
This will not affect the product, as the jar is included with the source of google-guice, but no functionality requiring struts2 is implemented.


Note You need to log in before you can comment on or make changes to this bug.