File tree Expand file tree Collapse file tree 7 files changed +8
-13
lines changed
csharp/ql/test/experimental/Security Features/CWE-1004/CookieWithoutHttpOnlyAspNetCore Expand file tree Collapse file tree 7 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 1- | Program.cs:7 :9:7 :49 | call to method Append | Cookie attribute 'HttpOnly' is not set to true. |
2- | Program.cs:17 :29:17 :73 | object creation of type CookieOptions | Cookie attribute 'HttpOnly' is not set to true. |
1+ | Program.cs:5 :9:5 :49 | call to method Append | Cookie attribute 'HttpOnly' is not set to true. |
2+ | Program.cs:15 :29:15 :73 | object creation of type CookieOptions | Cookie attribute 'HttpOnly' is not set to true. |
Original file line number Diff line number Diff line change 1- // semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs
2-
31public class MyController : Microsoft . AspNetCore . Mvc . Controller
42{
53 public void CookieDefault ( )
Original file line number Diff line number Diff line change 1- // semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31using Microsoft . AspNetCore . Builder ;
42using Microsoft . AspNetCore . Hosting ;
53
Original file line number Diff line number Diff line change 1- // semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.Cookies.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Authentication.cs ${testdir}/../../../../../resources/stubs/Microsoft.Extensions.DependencyInjection.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31using Microsoft . AspNetCore . Builder ;
42using Microsoft . AspNetCore . Hosting ;
53using Microsoft . Extensions . DependencyInjection ;
Original file line number Diff line number Diff line change 1- | Program.cs:10 :9:10 :49 | call to method Append | Cookie attribute 'HttpOnly' is not set to true. |
2- | Program.cs:15 :29:15 :73 | object creation of type CookieOptions | Cookie attribute 'HttpOnly' is not set to true. |
1+ | Program.cs:8 :9:8 :49 | call to method Append | Cookie attribute 'HttpOnly' is not set to true. |
2+ | Program.cs:13 :29:13 :73 | object creation of type CookieOptions | Cookie attribute 'HttpOnly' is not set to true. |
Original file line number Diff line number Diff line change 1- // semmle-extractor-options: ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.CookiePolicy.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Hosting.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Http.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Mvc.cs ${testdir}/../../../../../resources/stubs/Microsoft.AspNetCore.Builder.cs
2-
31using Microsoft . AspNetCore . Builder ;
42using Microsoft . AspNetCore . Hosting ;
53
@@ -22,6 +20,6 @@ public class Startup
2220 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
2321 public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
2422 {
25- app . UseCookiePolicy ( new CookiePolicyOptions ( ) { HttpOnly = Microsoft . AspNetCore . CookiePolicy . HttpOnlyPolicy . None } ) ;
23+ app . UseCookiePolicy ( new CookiePolicyOptions ( ) { HttpOnly = Microsoft . AspNetCore . CookiePolicy . HttpOnlyPolicy . None } ) ;
2624 }
2725}
Original file line number Diff line number Diff line change 1+ 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: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App.csproj
You can’t perform that action at this time.
0 commit comments