Merge pull request #15086 from michaelnebel/csharp/testusemorestubs

C#: Base more tests purely on stubs.
This commit is contained in:
Michael Nebel
2023-12-13 11:19:38 +01:00
committed by GitHub
30 changed files with 56 additions and 48 deletions

View File

@@ -1,4 +1,4 @@
| Program.cs:25:27:25:31 | false | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:30:74:30:78 | false | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:50:27:50:27 | access to local variable v | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:56:74:56:74 | access to local variable v | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:23:27:23:31 | false | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:28:74:28:78 | false | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:48:27:48:27 | access to local variable v | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:54:74:54:74 | access to local variable v | Cookie attribute 'HttpOnly' is not set to true. |

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

@@ -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 +1 @@
| Program.cs:7:22:7:59 | object creation of type HttpCookie | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:5:22:5:59 | object creation of type HttpCookie | Cookie attribute 'HttpOnly' is not set to true. |

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 +1 @@
| Program.cs:7:22:7:59 | object creation of type HttpCookie | Cookie attribute 'HttpOnly' is not set to true. |
| Program.cs:5:22:5:59 | object creation of type HttpCookie | Cookie attribute 'HttpOnly' is not set to true. |

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

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

View File

@@ -1,2 +1,2 @@
| script.aspx:1:1:1:75 | <%@Page ...%> | Test.cs:11:11:11:24 | CodeBehindPage |
| test.aspx:1:1:1:56 | <%@Page ...%> | Test.cs:11:11:11:24 | CodeBehindPage |
| script.aspx:1:1:1:75 | <%@Page ...%> | Test.cs:13:11:13:24 | CodeBehindPage |
| test.aspx:1:1:1:56 | <%@Page ...%> | Test.cs:13:11:13:24 | CodeBehindPage |

View File

@@ -1,4 +1,6 @@
// semmle-extractor-options: ${testdir}/../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
// 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
using System;
using System.Web;

View File

@@ -7,12 +7,6 @@ namespace System.ServiceModel
public sealed class OperationContractAttribute : Attribute { }
}
namespace System.Runtime.Serialization
{
public sealed class DataContractAttribute : Attribute { }
public sealed class DataMemberAttribute : Attribute { }
}
namespace RemoteFlowSource
{
using System.ServiceModel;

View File

@@ -1 +1,3 @@
semmle-extractor-options: /r:System.Net.dll /r:System.Web.dll /r:System.Net.HttpListener.dll /r:System.Collections.Specialized.dll /r:System.Private.Uri.dll /r:System.Security.Cryptography.X509Certificates.dll ${testdir}/../../../../resources/stubs/System.Web.cs
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

@@ -2,10 +2,10 @@
| Controller.cs:11:62:11:66 | taint | ASP.NET MVC action method parameter |
| Controller.cs:16:43:16:52 | sampleData | ASP.NET MVC action method parameter |
| Controller.cs:16:62:16:66 | taint | ASP.NET MVC action method parameter |
| RemoteFlowSource.cs:36:17:36:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:37:17:37:23 | access to parameter textBox | ASP.NET user input |
| RemoteFlowSource.cs:40:44:40:53 | sampleData | web service input |
| RemoteFlowSource.cs:40:63:40:67 | taint | web service input |
| RemoteFlowSource.cs:46:17:46:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:51:17:51:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:51:17:51:42 | access to property RawUrl | ASP.NET unvalidated request data |
| RemoteFlowSource.cs:30:17:30:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:31:17:31:23 | access to parameter textBox | ASP.NET user input |
| RemoteFlowSource.cs:34:44:34:53 | sampleData | web service input |
| RemoteFlowSource.cs:34:63:34:67 | taint | web service input |
| RemoteFlowSource.cs:40:17:40:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:45:17:45:23 | access to parameter request | ASP.NET query string |
| RemoteFlowSource.cs:45:17:45:42 | access to property RawUrl | ASP.NET unvalidated request data |

View File

@@ -1,2 +1,3 @@
semmle-extractor-options: /r:System.Linq.dll /r:System.Collections.Specialized.dll
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