2
2
* Provides a taint-tracking configuration for detecting
3
3
* "Server side request forgery" vulnerabilities.
4
4
*
5
- * Note, for performance reasons: only import this file if `Configuration` is needed,
6
- * otherwise `ServerSideRequestForgeryCustomizations` should be imported instead.
5
+ * Note, for performance reasons: only import this file if
6
+ * `ServerSideRequestForgeryFlow` is needed, otherwise
7
+ * `ServerSideRequestForgeryCustomizations` should be imported instead.
7
8
*/
8
9
9
10
import codeql.ruby.DataFlow
@@ -14,8 +15,9 @@ import codeql.ruby.dataflow.BarrierGuards
14
15
/**
15
16
* A taint-tracking configuration for detecting
16
17
* "Server side request forgery" vulnerabilities.
18
+ * DEPRECATED: Use `ServerSideRequestForgeryFlow`
17
19
*/
18
- class Configuration extends TaintTracking:: Configuration {
20
+ deprecated class Configuration extends TaintTracking:: Configuration {
19
21
Configuration ( ) { this = "ServerSideRequestForgery" }
20
22
21
23
override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
@@ -32,3 +34,20 @@ class Configuration extends TaintTracking::Configuration {
32
34
guard instanceof SanitizerGuard
33
35
}
34
36
}
37
+
38
+ private module ServerSideRequestForgeryConfig implements DataFlow:: ConfigSig {
39
+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
40
+
41
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
42
+
43
+ predicate isBarrier ( DataFlow:: Node node ) {
44
+ node instanceof Sanitizer or
45
+ node instanceof StringConstCompareBarrier or
46
+ node instanceof StringConstArrayInclusionCallBarrier
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Taint-tracking for detecting "Server side request forgery" vulnerabilities.
52
+ */
53
+ module ServerSideRequestForgeryFlow = TaintTracking:: Global< ServerSideRequestForgeryConfig > ;
0 commit comments