mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
C#: Add tests for PersistentCookie.ql
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// semmle-extractor-options: ${testdir}/../../../../resources/stubs/System.Web.cs /r:System.Collections.Specialized.dll
|
||||
using System;
|
||||
|
||||
class PersistentCookie
|
||||
{
|
||||
void M(System.Web.HttpCookie cookie)
|
||||
{
|
||||
cookie.Expires = DateTime.Now.AddMonths(12); // BAD
|
||||
cookie.Expires = DateTime.Now.AddMinutes(3); // GOOD
|
||||
cookie.Expires = DateTime.Now.AddSeconds(301); // BAD
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
| PersistentCookie.cs:8:9:8:51 | ... = ... | Avoid persistent cookies. |
|
||||
| PersistentCookie.cs:10:9:10:53 | ... = ... | Avoid persistent cookies. |
|
||||
@@ -0,0 +1 @@
|
||||
Security Features/PersistentCookie.ql
|
||||
Reference in New Issue
Block a user