Skip to content

Commit 3818971

Browse files
committed
Add redirect sinks
Both the familiy of `Accepted` and `Created` method set the location header based on provided input. If this is untrusted input this can result in an URL redirect attack.
1 parent bed10ad commit 3818971

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

csharp/ql/src/semmle/code/csharp/frameworks/microsoft/AspNetCore.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,13 @@ class MicrosoftAspNetCoreMvcController extends Class {
195195
/** Gets a `Redirect*` method. */
196196
Method getARedirectMethod() {
197197
result = this.getAMethod() and
198-
result.getName().matches("Redirect%")
198+
(
199+
result.getName().matches("Redirect%")
200+
or
201+
result.getName().matches("Accepted%")
202+
or
203+
result.getName().matches("Created%")
204+
)
199205
}
200206
}
201207

0 commit comments

Comments
 (0)