File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
lib/semmle/code/java/frameworks/ratpack
test/library-tests/frameworks/ratpack/resources Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ private class RatpackExecModel extends SummaryModelCsv {
22
22
"blockingMap;;;Element of Argument[-1];Parameter[0] of Argument[0];value" ,
23
23
"blockingMap;;;ReturnValue of Argument[0];Element of ReturnValue;value" ,
24
24
"mapError;;;ReturnValue of Argument[0];Element of ReturnValue;value" ,
25
+ // `apply` passes the qualifier to the function as the first argument
26
+ "apply;;;Element of Argument[-1];Element of Parameter[0] of Argument[0];value" ,
27
+ "apply;;;Element of ReturnValue of Argument[0];Element of ReturnValue;value" ,
25
28
// `Promise` termination method
26
29
"then;;;Element of Argument[-1];Parameter[0] of Argument[0];value" ,
27
30
// 'next' accesses qualfier the 'Promise' value and also returns the qualifier
Original file line number Diff line number Diff line change @@ -230,6 +230,26 @@ public static String identity(String input) {
230
230
}
231
231
232
232
void test10 () {
233
+ String tainted = taint ();
234
+ Promise
235
+ .value (tainted )
236
+ .apply (Resource ::promiseIdentity )
237
+ .then (value -> {
238
+ sink (value ); //$hasTaintFlow
239
+ });
240
+ Promise
241
+ .value ("potato" )
242
+ .apply (Resource ::promiseIdentity )
243
+ .then (value -> {
244
+ sink (value ); // no taints flow
245
+ });
246
+ }
247
+
248
+ public static Promise <String > promiseIdentity (Promise <String > input ) {
249
+ return input .map (i -> i );
250
+ }
251
+
252
+ void test11 () {
233
253
String tainted = taint ();
234
254
Promise
235
255
.value (tainted )
@@ -245,7 +265,7 @@ void test10() {
245
265
});
246
266
}
247
267
248
- void test11 () {
268
+ void test12 () {
249
269
String tainted = taint ();
250
270
Promise
251
271
.sync (() -> tainted )
You can’t perform that action at this time.
0 commit comments