mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Taint flow through org.springframework.data.repository.CrudRepository.save().
This commit is contained in:
19
java/ql/test/library-tests/frameworks/spring/data/Test.java
Normal file
19
java/ql/test/library-tests/frameworks/spring/data/Test.java
Normal file
@@ -0,0 +1,19 @@
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
class Struct {
|
||||
public String field;
|
||||
public Struct(String f){
|
||||
this.field = f;
|
||||
}
|
||||
}
|
||||
|
||||
public class Test {
|
||||
String source() { return null; }
|
||||
void sink(Object o) {}
|
||||
|
||||
void testCrudRepository(CrudRepository<Struct, Integer> cr) {
|
||||
Struct s = new Struct(source());
|
||||
s = cr.save(s);
|
||||
sink(s.field); //$hasValueFlow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/spring-data-commons-2.5.1
|
||||
@@ -0,0 +1,2 @@
|
||||
import java
|
||||
import TestUtilities.InlineFlowTest
|
||||
Reference in New Issue
Block a user