@@ -56,11 +56,16 @@ deprecated class RemoteSource extends DataFlow::Node instanceof RemoteFlowSource
5656/** A source supported by the current threat model. */
5757class ThreatModelSource extends Source instanceof ActiveThreatModelSource { }
5858
59- /** URL Redirection sinks defined through Models as Data. */
59+ /** A URL Redirection sink defined through Models as Data. */
6060private class ExternalUrlRedirectExprSink extends Sink {
6161 ExternalUrlRedirectExprSink ( ) { sinkNode ( this , "url-redirection" ) }
6262}
6363
64+ /** A sanitizer for URL redirection defined through Models as Data. */
65+ private class ExternalUrlRedirectSanitizer extends Sanitizer {
66+ ExternalUrlRedirectSanitizer ( ) { barrierNode ( this , "url-redirection" ) }
67+ }
68+
6469/**
6570 * A URL argument to a call to `HttpResponse.Redirect()` or `Controller.Redirect()`, that is a
6671 * sink for URL redirects.
@@ -160,27 +165,6 @@ class ContainsUrlSanitizer extends Sanitizer {
160165 }
161166}
162167
163- /**
164- * A check that the URL is relative, and therefore safe for URL redirects.
165- */
166- private predicate isRelativeUrlSanitizer ( Guard guard , Expr e , GuardValue v ) {
167- guard =
168- any ( PropertyAccess access |
169- access .getProperty ( ) .hasFullyQualifiedName ( "System" , "Uri" , "IsAbsoluteUri" ) and
170- e = access .getQualifier ( ) and
171- v .asBooleanValue ( ) = false
172- )
173- }
174-
175- /**
176- * A check that the URL is relative, and therefore safe for URL redirects.
177- */
178- class RelativeUrlSanitizer extends Sanitizer {
179- RelativeUrlSanitizer ( ) {
180- this = DataFlow:: BarrierGuard< isRelativeUrlSanitizer / 3 > :: getABarrierNode ( )
181- }
182- }
183-
184168/**
185169 * A comparison on the `Host` property of a url, that is a sanitizer for URL redirects.
186170 * E.g. `url.Host == "example.org"`
@@ -205,16 +189,6 @@ class HostComparisonSanitizer extends Sanitizer {
205189 }
206190}
207191
208- /**
209- * A call to the getter of the RawUrl property, whose value is considered to be safe for URL
210- * redirects.
211- */
212- class RawUrlSanitizer extends Sanitizer {
213- RawUrlSanitizer ( ) {
214- this .getExpr ( ) = any ( SystemWebHttpRequestClass r ) .getRawUrlProperty ( ) .getGetter ( ) .getACall ( )
215- }
216- }
217-
218192/**
219193 * A string concatenation expression, where the left hand side contains the character "?".
220194 *
0 commit comments