From 4eb4787692c97c8a6fe2542ca615c684b9d67f63 Mon Sep 17 00:00:00 2001 From: edvraa <80588099+edvraa@users.noreply.github.com> Date: Mon, 10 May 2021 17:20:47 +0300 Subject: [PATCH] simplify expressions --- ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql b/ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql index e2230112d0c..8c8aa152475 100644 --- a/ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql +++ b/ql/src/experimental/CWE-1004/CookieWithoutHttpOnly.ql @@ -20,9 +20,7 @@ predicate isNetHttpCookieFlow(DataFlow::PathNode source, DataFlow::PathNode sink exists(DataFlow::PathNode cookieCreate, DataFlow::PathNode setCookieSink | exists(NetHttpCookieTrackingConfiguration cfg | cfg.hasFlowPath(cookieCreate, setCookieSink)) and ( - not exists(DataFlow::Node rhs | - rhs = getValueForFieldWrite(cookieCreate.getNode().asExpr(), "HttpOnly") - ) and + not exists(getValueForFieldWrite(cookieCreate.getNode().asExpr(), "HttpOnly")) and source = cookieCreate and sink = setCookieSink or @@ -36,14 +34,12 @@ predicate isNetHttpCookieFlow(DataFlow::PathNode source, DataFlow::PathNode sink } predicate isGinContextCookieFlow(DataFlow::PathNode source, DataFlow::PathNode sink) { - exists(BoolToGinSetCookieTrackingConfiguration cfg | cfg.hasFlowPath(source, sink)) + any(BoolToGinSetCookieTrackingConfiguration cfg).hasFlowPath(source, sink) } predicate isGorillaSessionsCookieFlow(DataFlow::PathNode source, DataFlow::PathNode sink) { exists(DataFlow::PathNode cookieStoreCreate, DataFlow::PathNode sessionSave | - exists(GorillaCookieStoreSaveTrackingConfiguration cfg | - cfg.hasFlowPath(cookieStoreCreate, sessionSave) - ) and + any(GorillaCookieStoreSaveTrackingConfiguration cfg).hasFlowPath(cookieStoreCreate, sessionSave) and ( not exists(GorillaSessionOptionsTrackingConfiguration cfg, DataFlow::PathNode sessionSave2 | sessionSave2.getNode() = sessionSave.getNode() and