We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39402b8 commit e45e06bCopy full SHA for e45e06b
csharp/ql/test/query-tests/Security Features/CWE-117/LogForgingAsp.cs
@@ -0,0 +1,21 @@
1
+using System;
2
+using Microsoft.AspNetCore.Http;
3
+using Microsoft.AspNetCore.Http.Headers;
4
+using Microsoft.AspNetCore.Mvc;
5
+
6
+public class AspController : ControllerBase
7
+{
8
+ public void Action1(string username)
9
+ {
10
+ var logger = new ILogger();
11
+ // BAD: Logged as-is
12
+ logger.Warn(username + " logged in");
13
+ }
14
15
+ public void Action1(DateTime date)
16
17
18
+ // GOOD: DateTime is a sanitizer. (FALSE POSITIVE)
19
+ logger.Warn($"Warning about the date: {date:yyyy-MM-dd}");
20
21
+}
0 commit comments