@@ -42,8 +42,12 @@ class JsonIoUseMapsSetter extends MethodAccess {
42
42
}
43
43
}
44
44
45
- /** A data flow configuration tracing flow from JsonIo safe settings. */
46
- class SafeJsonIoConfig extends DataFlow2:: Configuration {
45
+ /**
46
+ * DEPRECATED: Use `SafeJsonIoFlow` instead.
47
+ *
48
+ * A data flow configuration tracing flow from JsonIo safe settings.
49
+ */
50
+ deprecated class SafeJsonIoConfig extends DataFlow2:: Configuration {
47
51
SafeJsonIoConfig ( ) { this = "UnsafeDeserialization::SafeJsonIoConfig" }
48
52
49
53
override predicate isSource ( DataFlow:: Node src ) {
@@ -65,3 +69,30 @@ class SafeJsonIoConfig extends DataFlow2::Configuration {
65
69
)
66
70
}
67
71
}
72
+
73
+ /**
74
+ * A data flow configuration tracing flow from JsonIo safe settings.
75
+ */
76
+ module SafeJsonIoConfig implements DataFlow:: ConfigSig {
77
+ predicate isSource ( DataFlow:: Node src ) {
78
+ exists ( MethodAccess ma |
79
+ ma instanceof JsonIoUseMapsSetter and
80
+ src .asExpr ( ) = ma .getQualifier ( )
81
+ )
82
+ }
83
+
84
+ predicate isSink ( DataFlow:: Node sink ) {
85
+ exists ( MethodAccess ma |
86
+ ma .getMethod ( ) instanceof JsonIoJsonToJavaMethod and
87
+ sink .asExpr ( ) = ma .getArgument ( 1 )
88
+ )
89
+ or
90
+ exists ( ClassInstanceExpr cie |
91
+ cie .getConstructor ( ) .getDeclaringType ( ) instanceof JsonIoJsonReader and
92
+ sink .asExpr ( ) = cie .getArgument ( 1 )
93
+ )
94
+ }
95
+ }
96
+
97
+ /** Tracks flow from JsonIo safe settings. */
98
+ module SafeJsonIoFlow = DataFlow:: Global< SafeJsonIoConfig > ;
0 commit comments