Struts DevMode is a development feature in Apache Struts that, when enabled in production, exposes detailed error information and OGNL evaluation capabilities that can lead to remote code execution.
# With devMode=true, error pages may allow OGNL injection
# Or debug parameters can evaluate expressions
# Request with OGNL payload:
?debug=command&expression=%23rt=@java.lang.Runtime@getRuntime(),%23rt.exec('whoami')
# Results in command execution
# Check struts.xml or struts.properties
<constant name="struts.devMode" value="true"/>
# Or in web.xml
struts.devMode = true
# Signs in responses:
- Detailed Java stack traces
- OGNL expression errors
- Debug information
# struts.xml - NEVER enable in production
<constant name="struts.devMode" value="false"/>
# Or in struts.properties
struts.devMode=false
Many critical Struts CVEs (like CVE-2017-5638) are related to OGNL injection. DevMode compounds the risk by exposing additional evaluation vectors.