Skip to content

Commit 017c73d

Browse files
erik-kroghasgerf
andcommitted
Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
1 parent ff054b9 commit 017c73d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

change-notes/1.26/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
| Unsafe jQuery plugin (`js/unsafe-jquery-plugin`) | More results | This query now detects more unsafe uses of nested option properties. |
4444
| Client-side URL redirect (`js/client-side-unvalidated-url-redirection`) | More results | This query now recognizes some unsafe uses of `importScripts()` inside WebWorkers. |
4545
| Missing CSRF middleware (`js/missing-token-validation`) | More results | This query now recognizes writes to cookie and session variables as potentially vulnerable to CSRF attacks. |
46-
| Missing CSRF middleware (`js/missing-token-validation`) | Less results | This query now recognizes more ways of protecting against CSRF attacks. |
46+
| Missing CSRF middleware (`js/missing-token-validation`) | Fewer results | This query now recognizes more ways of protecting against CSRF attacks. |
4747

4848

4949
## Changes to libraries

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private Express::RouteHandler getAHandlerSettingCsrfCookie() {
126126
* This is indicated either by the request parameter having a CSRF related write to a session variable.
127127
* Or by the response parameter setting a CSRF related cookie.
128128
*/
129-
predicate isACsrfProtectionRouteHandler(Express::RouteHandler handler) {
129+
predicate isCsrfProtectionRouteHandler(Express::RouteHandler handler) {
130130
DataFlow::parameterNode(handler.getRequestParameter()) =
131131
nodeLeadingToCsrfWrite(DataFlow::TypeBackTracker::end())
132132
or
@@ -136,7 +136,7 @@ predicate isACsrfProtectionRouteHandler(Express::RouteHandler handler) {
136136
/** Gets a data flow node refering to a route handler that is protecting against CSRF. */
137137
private DataFlow::SourceNode getACsrfProtectionRouteHandler(DataFlow::TypeTracker t) {
138138
t.start() and
139-
isACsrfProtectionRouteHandler(result)
139+
isCsrfProtectionRouteHandler(result)
140140
or
141141
exists(DataFlow::TypeTracker t2, DataFlow::SourceNode pred |
142142
pred = getACsrfProtectionRouteHandler(t2)
@@ -150,7 +150,7 @@ private DataFlow::SourceNode getACsrfProtectionRouteHandler(DataFlow::TypeTracke
150150

151151
/**
152152
* Gets an express route handler expression that is either a custom CSRF protection middleware,
153-
* or a CSFR protecting library.
153+
* or a CSRF protecting library.
154154
*/
155155
Express::RouteHandlerExpr getACsrfMiddleware() {
156156
csrfMiddlewareCreation().flowsToExpr(result)

0 commit comments

Comments
 (0)