mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Add sample
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Bad: arbitrary code execution
|
||||
// Bad: ScriptEngine allows arbitrary code injection
|
||||
ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
|
||||
ScriptEngine scriptEngine = scriptEngineManager.getEngineByExtension("js");
|
||||
Object result = scriptEngine.eval(code);
|
||||
@@ -14,9 +14,7 @@ Use "Cloudbees Rhino Sandbox" or sandboxing with SecurityManager or use <a href=
|
||||
|
||||
<example>
|
||||
The following code could executes random JavaScript code
|
||||
ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
|
||||
ScriptEngine scriptEngine = scriptEngineManager.getEngineByExtension("js");
|
||||
Object result = scriptEngine.eval(code);
|
||||
<sample src="ScriptEngine.java" />
|
||||
</example>
|
||||
|
||||
<references>
|
||||
|
||||
Reference in New Issue
Block a user