You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JAVA : Add query to detect Apache Structs enabled DEvmode
This query detects cases where the development mode is enabled for a
struts configuration. I can't find a CVE per se but, at present, [Github's fuzzy search](https://github.com/search?q=%3Cconstant+name%3D%22struts.devMode%22+value%3D%22true%22+%2F%3E+language%3Axml&type=Code) returns more
than 44000 results. Some of them look like they are classroom projects,
so they may be ineligible for a CVE. But we should be flagging them
anyways as setting the development on in a production system is a very
bad practice and can often lead to remote code execution.
So these should be fixed anyways.
<!DOCTYPEqhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd">
2
+
<qhelp>
3
+
4
+
<overview>
5
+
<p>Turning Apache Struts' development mode configuration on while deploying applications to production environments can lead to remote code execution.</p>
6
+
7
+
</overview>
8
+
<recommendation>
9
+
10
+
<p>An application should disable the development mode at the time of deployment.</p>
11
+
12
+
</recommendation>
13
+
<example>
14
+
15
+
<p>The following example shows a `struts.xml` file with `struts.devmode` enabled.</p>
16
+
17
+
<samplesrc="strutsBad.xml" />
18
+
19
+
<p>This can be easily corrected by setting the value of the `struts.devmode` parameter to false.</p>
20
+
21
+
<samplesrc="structGood.xml" />
22
+
23
+
</example>
24
+
<references>
25
+
26
+
<li>
27
+
Apache Struts:
28
+
<ahref="https://struts.apache.org/core-developers/development-mode.html">Struts development mode configuration</a>
0 commit comments