C#: Base the CWE-614 tests purely on stubs.

This commit is contained in:
Michael Nebel
2023-12-12 15:30:56 +01:00
parent 4fc8762444
commit 94d81b501b
13 changed files with 21 additions and 16 deletions

View File

@@ -1,5 +1,3 @@
// semmle-extractor-options: ${testdir}/../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
class Program
{
void CookieDirectTrue()

View File

@@ -1,4 +1,4 @@
| Program.cs:19:25:19:29 | false | Cookie attribute 'Secure' is not set to true. |
| Program.cs:24:73:24:77 | false | Cookie attribute 'Secure' is not set to true. |
| Program.cs:44:25:44:25 | access to local variable v | Cookie attribute 'Secure' is not set to true. |
| Program.cs:50:73:50:73 | access to local variable v | Cookie attribute 'Secure' is not set to true. |
| Program.cs:17:25:17:29 | false | Cookie attribute 'Secure' is not set to true. |
| Program.cs:22:73:22:77 | false | Cookie attribute 'Secure' is not set to true. |
| Program.cs:42:25:42:25 | access to local variable v | Cookie attribute 'Secure' is not set to true. |
| Program.cs:48:73:48:73 | access to local variable v | Cookie attribute 'Secure' is not set to true. |

View File

@@ -0,0 +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

View File

@@ -1,5 +1,3 @@
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
class Program
{
void CookieDefault()

View File

@@ -1 +1 @@
| Program.cs:7:22:7:60 | object creation of type HttpCookie | Cookie attribute 'Secure' is not set to true. |
| Program.cs:5:22:5:60 | object creation of type HttpCookie | Cookie attribute 'Secure' is not set to true. |

View File

@@ -0,0 +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

View File

@@ -1,5 +1,3 @@
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
class Program
{
void CookieDefault()

View File

@@ -1 +1 @@
| Program.cs:7:22:7:60 | object creation of type HttpCookie | Cookie attribute 'Secure' is not set to true. |
| Program.cs:5:22:5:60 | object creation of type HttpCookie | Cookie attribute 'Secure' is not set to true. |

View File

@@ -0,0 +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

View File

@@ -1,5 +1,3 @@
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
class Program
{
void CookieDefault()

View File

@@ -0,0 +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

View File

@@ -1,5 +1,3 @@
// semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
class Program
{
void CookieDefault()

View File

@@ -0,0 +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