@@ -17,9 +17,11 @@ module ServerSideRequestForgery {
1717 private import semmle.go.dataflow.Properties
1818
1919 /**
20+ * DEPRECATED: Use `Flow` instead.
21+ *
2022 * A taint-tracking configuration for reasoning about request forgery.
2123 */
22- class Configuration extends TaintTracking:: Configuration {
24+ deprecated class Configuration extends TaintTracking:: Configuration {
2325 Configuration ( ) { this = "SSRF" }
2426
2527 override predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
@@ -44,6 +46,25 @@ module ServerSideRequestForgery {
4446 }
4547 }
4648
49+ private module Config implements DataFlow:: ConfigSig {
50+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
51+
52+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
53+
54+ predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
55+ // propagate to a URL when its host is assigned to
56+ exists ( Write w , Field f , SsaWithFields v | f .hasQualifiedName ( "net/url" , "URL" , "Host" ) |
57+ w .writesField ( v .getAUse ( ) , f , node1 ) and node2 = v .getAUse ( )
58+ )
59+ }
60+
61+ predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
62+
63+ predicate isBarrierOut ( DataFlow:: Node node ) { node instanceof SanitizerEdge }
64+ }
65+
66+ module Flow = TaintTracking:: Global< Config > ;
67+
4768 /** A data flow source for request forgery vulnerabilities. */
4869 abstract class Source extends DataFlow:: Node { }
4970
0 commit comments