Critical severity9.8NVD Advisory· Published Sep 20, 2017· Updated May 13, 2026
CVE-2017-12611
CVE-2017-12611
Description
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
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.struts:struts2-coreMaven | >= 2.0.1, < 2.3.34 | 2.3.34 |
org.apache.struts:struts2-coreMaven | >= 2.5.0, < 2.5.11 | 2.5.11 |
Affected products
1- Apache Software Foundation/Apache Strutsv5Range: 2.0.0 - 2.3.33
Patches
22306f5f7fad7Uses better class resolver logic
1 file changed · +4 −0
core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java+4 −0 modified@@ -34,6 +34,7 @@ import freemarker.cache.MultiTemplateLoader; import freemarker.cache.TemplateLoader; import freemarker.cache.WebappTemplateLoader; +import freemarker.core.TemplateClassResolver; import freemarker.ext.jsp.TaglibFactory; import freemarker.ext.servlet.HttpRequestHashModel; import freemarker.ext.servlet.HttpRequestParametersHashModel; @@ -344,6 +345,9 @@ protected Configuration createConfiguration(ServletContext servletContext) throw configuration.setLocalizedLookup(false); configuration.setWhitespaceStripping(true); + LOG.debug("Sets NewBuiltinClassResolver to TemplateClassResolver.SAFER_RESOLVER"); + configuration.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER); + return configuration; }
1 file changed · +8 −0
core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java+8 −0 modified@@ -28,6 +28,7 @@ import com.opensymphony.xwork2.util.ClassLoaderUtil; import com.opensymphony.xwork2.util.ValueStack; import freemarker.cache.*; +import freemarker.core.TemplateClassResolver; import freemarker.ext.jsp.TaglibFactory; import freemarker.ext.servlet.HttpRequestHashModel; import freemarker.ext.servlet.HttpRequestParametersHashModel; @@ -318,16 +319,23 @@ protected Configuration createConfiguration(ServletContext servletContext) throw configuration.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER); if (mruMaxStrongSize > 0) { + LOG.debug("Sets Configuration.CACHE_STORAGE_KEY to strong:{}", mruMaxStrongSize); configuration.setSetting(Configuration.CACHE_STORAGE_KEY, "strong:" + mruMaxStrongSize); } if (templateUpdateDelay != null) { + LOG.debug("Sets Configuration.TEMPLATE_UPDATE_DELAY_KEY to {}", templateUpdateDelay); configuration.setSetting(Configuration.TEMPLATE_UPDATE_DELAY_KEY, templateUpdateDelay); } if (encoding != null) { + LOG.debug("Sets DefaultEncoding to {}", encoding); configuration.setDefaultEncoding(encoding); } + LOG.debug("Disabled localized lookups"); configuration.setLocalizedLookup(false); + LOG.debug("Enabled whitespace stripping"); configuration.setWhitespaceStripping(true); + LOG.debug("Sets NewBuiltinClassResolver to TemplateClassResolver.SAFER_RESOLVER"); + configuration.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER); return configuration; }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- www.oracle.com/technetwork/security-advisory/alert-cve-2017-9805-3889403.htmlnvdPatchThird Party AdvisoryWEB
- kb.netapp.com/support/s/article/ka51A000000CgttQAC/NTAP-20170911-0001nvdPatchThird Party AdvisoryWEB
- struts.apache.org/docs/s2-053.htmlnvdExploitVendor AdvisoryWEB
- www.arubanetworks.com/assets/alert/ARUBA-PSA-2017-003.txtnvdMitigationThird Party AdvisoryWEB
- www.securityfocus.com/bid/100829nvdThird Party AdvisoryVDB Entry
- github.com/advisories/GHSA-8fx9-5hx8-crhmghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2017-12611ghsaADVISORY
- github.com/apache/struts/commit/2306f5f7fad7f0157f216f34331238feb0539faghsaWEB
- github.com/apache/struts/commit/637ad1c3707266c33daabb18d7754e795e6681fghsaWEB
- web.archive.org/web/20170923161654/http://www.securityfocus.com/bid/100829ghsaWEB
News mentions
0No linked articles in our index yet.