Skip to content

Commit 96e917f

Browse files
Add additional test case for httponly cookies set to true
1 parent 31caadf commit 96e917f

File tree

9 files changed

+17
-2
lines changed

9 files changed

+17
-2
lines changed

csharp/ql/test/query-tests/Security Features/CWE-1004/HttpOnlyCookie/SystemWeb/HttpOnlyCookiesTrue/CookieWithoutHttpOnly.expected

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
query: Security Features/CWE-1004/CookieWithoutHttpOnly.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Program
2+
{
3+
void CookieDefault()
4+
{
5+
var cookie = new System.Web.HttpCookie("auth"); // GOOD: httpOnlyCookies is set to true in config
6+
}
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<system.web>
4+
<httpCookies httpOnlyCookies="true"/>
5+
</system.web>
6+
</configuration>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
semmle-extractor-options: /nostdlib /noconfig
2-
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
3-
semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs
2+
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
3+
semmle-extractor-options: ${testdir}/../../../../../../resources/stubs/System.Web.cs

0 commit comments

Comments
 (0)