File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
java/ql/test/library-tests/dataflow/taintsources Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ import io .micronaut .context .annotation .Value ;
2+ import io .micronaut .context .annotation .Property ;
3+ import io .micronaut .http .annotation .*;
4+
5+ @ Controller ("/config" )
6+ class MicronautConfig {
7+
8+ private static void sink (Object o ) {}
9+
10+ @ Value ("${app.secret}" )
11+ String secretValue ;
12+
13+ @ Property (name = "app.api-key" )
14+ String apiKey ;
15+
16+ @ Get ("/secret" )
17+ void testValueField () {
18+ sink (secretValue ); // $hasLocalValueFlow
19+ }
20+
21+ @ Get ("/key" )
22+ void testPropertyField () {
23+ sink (apiKey ); // $hasLocalValueFlow
24+ }
25+
26+ @ Get ("/param" )
27+ void testValueParam (@ Value ("${app.name}" ) String appName ) {
28+ sink (appName ); // $hasLocalValueFlow
29+ }
30+ }
Original file line number Diff line number Diff line change 1- //semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/jakarta.servlet-api-6.0.0:${testdir}/../../../stubs/apache-commons-fileupload-1.4:${testdir}/../../../stubs/javax-servlet-2.5:${testdir}/../../../stubs/servlet-api-2.4:${testdir}/../../../stubs/springframework-5.8.x:${testdir}/../../../stubs/google-android-9.0.0:${testdir}/../../../stubs/playframework-2.6.x:${testdir}/../../../stubs/jackson-databind-2.12:${testdir}/../../../stubs/jackson-core-2.12:${testdir}/../../../stubs/akka-2.6.x:${testdir}/../../../stubs/jwtk-jjwt-0.11.2:${testdir}/../../../stubs/jenkins:${testdir}/../../../stubs/stapler-1.263
1+ //semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/jakarta.servlet-api-6.0.0:${testdir}/../../../stubs/apache-commons-fileupload-1.4:${testdir}/../../../stubs/javax-servlet-2.5:${testdir}/../../../stubs/servlet-api-2.4:${testdir}/../../../stubs/springframework-5.8.x:${testdir}/../../../stubs/google-android-9.0.0:${testdir}/../../../stubs/playframework-2.6.x:${testdir}/../../../stubs/jackson-databind-2.12:${testdir}/../../../stubs/jackson-core-2.12:${testdir}/../../../stubs/akka-2.6.x:${testdir}/../../../stubs/jwtk-jjwt-0.11.2:${testdir}/../../../stubs/jenkins:${testdir}/../../../stubs/stapler-1.263:${testdir}/../../../stubs/micronaut-4.x
You can’t perform that action at this time.
0 commit comments