Skip to content

Commit

Permalink
fix: java testdata for code injection rule (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet authored Feb 8, 2024
1 parent 785f915 commit be7606c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/java/lang/code_injection/testdata/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

public class Foo {

public void bad(String script, HttpServletResponse response) throws Exception {
public void bad(String script, HttpServletRequest req, HttpServletResponse res) {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("javascript");

engine.eval(script);
Invocable invocable = (Invocable) engine;

var foo = request.getParameter("foo");
var foo = req.getParameter("foo");

// bearer:expected java_lang_code_injection
String badFunc = (String) invocable.invokeFunction("myFunc", foo);
Expand Down

0 comments on commit be7606c

Please sign in to comment.