rvesse commented on code in PR #2096:
URL: https://github.com/apache/jena/pull/2096#discussion_r1409322805


##########
jena-arq/src/test/java/org/apache/jena/query/TestParameterizedSparqlString.java:
##########
@@ -1585,6 +1595,15 @@ public void test_param_string_injection_15() {
         pss.setLiteral(second, " . } ; DROP ALL ; INSERT DATA { <s> <p> ");
 
         pss.asUpdate();
+        // Due to the unpredictability of the order of parameters in 
this.params,
+        // which is a HashMap, here the reverse order is checked to make sure
+        // an ARQException is thrown
+        pss.setLiteral("var", "a");
+        pss.setLiteral("var2", "b");
+
+        pss.setLiteral(second, " ?" + first + " ");
+        pss.setLiteral(first, " . } ; DROP ALL ; INSERT DATA { <s> <p> ");
+

Review Comment:
   Missing a `pss.asUpdate()` call here as the injection doesn't get attempted 
until the user tries to convert the `ParameterizedSparqlString` into an update



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to