CVE-2010-1870: Struts2/XWork remote command execution
Apache Struts team has announced uploaded but has not released, due to an unreasonably prolonged voting process, the 2.2.0 release of the Struts2 web framework which fixes vulnerability that I've reported to them on May 31st 2010. Apache Struts team is ridiculously slow in releasing the fixed version and all of my attempts to expedite the process have failed. Struts2 is Struts + WebWork. WebWork in turn uses XWork to invoke actions and call appropriate setters/getters based on HTTP parameter names, which is achieved by treating each HTTP parameter name as an OGNL statement. OGNL (Object Graph Navigation Language) is what turns user.address.city=Bishkek&user['favoriteDrink']=kumys into action.getUser().getAddress().setCity("Bishkek") action.getUser().setFavoriteDrink("kumys"). This is performed by the ParametersInterceptor, which calls ValueStack.setValue() with user-supplied HTTP parameters as arguments. In addition to property getting/setting, OGNL supports many more features such as method calling, static method calling, constructor calling, ability to work with context variables, and more. Since HTTP parameter names are OGNL statements, to prevent an attacker from calling arbitrary methods via HTTP parameters XWork has the following two variables guarding methods execution: OgnlContext's property 'xwork.MethodAccessor.denyMethodExecution' (set to true by default) and SecurityMemberAccess private field called 'allowStaticMethodAccess' (set to false by default). OGNL Context variables make it easier for developer to access various freqently used objects, OGNL context has a set of predefined variables. One of them is 'context' which is an instance of ActionContext. ActionContext in turn has a reference to ValueStack.