mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Include suggestions from review
This commit is contained in:
@@ -16,14 +16,14 @@
|
||||
<code>code</code>
|
||||
is used as a Velocity template string. This can lead to remote code execution.
|
||||
</p>
|
||||
<sample src="SSTIBad.py" />
|
||||
<sample src="SSTIBad.java" />
|
||||
|
||||
<p>
|
||||
In the next example the problem is avoided by using a fixed template string
|
||||
<code>s</code>
|
||||
. Since, the template is not attacker controlled in this case, we prevent untrusted code execution.
|
||||
</p>
|
||||
<sample src="SSTIGood.py" />
|
||||
<sample src="SSTIGood.java" />
|
||||
</example>
|
||||
<references>
|
||||
<li>Portswigger : [Server Side Template Injection](https://portswigger.net/web-security/server-side-template-injection)</li>
|
||||
|
||||
@@ -21,7 +21,7 @@ public class JinJavaSSTI {
|
||||
String template = request.getParameter("template");
|
||||
Jinjava jinjava = new Jinjava();
|
||||
Map<String, Object> context = new HashMap<>();
|
||||
// String render(String template, Map<String,?> bindings)
|
||||
// String render(String template, Map<String,?> bindings)
|
||||
String renderedTemplate = jinjava.render(template, context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user