Skip to content

Commit 5dc1ad6

Browse files
committed
Polish .ql
1 parent 0f2b81e commit 5dc1ad6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

python/ql/src/experimental/Security/CWE-614/InsecureCookie.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ secure flag and the second adds the secure flag in the cookie's raw value.</p>
2323
<li>PortSwigger: <a href="https://portswigger.net/kb/issues/00500200_tls-cookie-without-secure-flag-set">TLS cookie without secure flag set</a>.</li>
2424
</references>
2525

26-
</qhelp>
26+
</qhelp>

python/ql/src/experimental/Security/CWE-614/InsecureCookie.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@
1313
import python
1414
import semmle.python.dataflow.new.DataFlow
1515
import experimental.semmle.python.Concepts
16+
import experimental.semmle.python.CookieHeader
1617

1718
from Cookie cookie, string alert
1819
where
19-
cookie.isSecure() and
20+
not cookie.isSecure() and
2021
alert = "secure"
2122
or
2223
not cookie.isHttpOnly() and
2324
alert = "httponly"
2425
or
25-
cookie.isSameSite() and
26+
not cookie.isSameSite() and
2627
alert = "samesite"
2728
select cookie, "Cookie is added without the ", alert, " flag properly set."

0 commit comments

Comments
 (0)