Add additional test case for httponly cookies set to true

This commit is contained in:
Joe Farebrother
2025-10-24 16:00:25 +01:00
parent c734e74c76
commit d8eeae781b
9 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
query: Security Features/CWE-1004/CookieWithoutHttpOnly.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -0,0 +1,7 @@
class Program
{
void CookieDefault()
{
var cookie = new System.Web.HttpCookie("auth"); // GOOD: httpOnlyCookies is set to true in config
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpCookies httpOnlyCookies="true"/>
</system.web>
</configuration>

View File

@@ -1,3 +1,3 @@
semmle-extractor-options: /nostdlib /noconfig
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
semmle-extractor-options: ${testdir}/../../../../../../resources/stubs/System.Web.cs