Skip to content

Commit 27a2cd3

Browse files
committed
inline value in nodeLeadingToCsrfWrite
1 parent 017c73d commit 27a2cd3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

javascript/ql/src/Security/CWE-352/MissingCsrfMiddleware.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ DataFlow::CallNode csrfMiddlewareCreation() {
103103
*/
104104
private DataFlow::SourceNode nodeLeadingToCsrfWrite(DataFlow::TypeBackTracker t) {
105105
t.start() and
106-
exists(DataFlow::PropRef value |
107-
value = result.getAPropertyRead(cookieProperty()).getAPropertyWrite() and
108-
value.getPropertyName().regexpMatch("(?i).*(csrf|xsrf).*")
109-
)
106+
result
107+
.getAPropertyRead(cookieProperty())
108+
.getAPropertyWrite()
109+
.getPropertyName()
110+
.regexpMatch("(?i).*(csrf|xsrf).*")
110111
or
111112
exists(DataFlow::TypeBackTracker t2 | result = nodeLeadingToCsrfWrite(t2).backtrack(t2, t))
112113
}

0 commit comments

Comments
 (0)