Skip to content

Commit 8b53f8f

Browse files
committed
Fix, prevent addHook return values from being treated as XSS sinks
1 parent fdfdcc0 commit 8b53f8f

File tree

1 file changed

+5
-1
lines changed
  • javascript/ql/lib/semmle/javascript/frameworks

1 file changed

+5
-1
lines changed

javascript/ql/lib/semmle/javascript/frameworks/Fastify.qll

+5-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ module Fastify {
328328
ResponseSendArgument() {
329329
this = rh.getAResponseSource().ref().getAMethodCall("send").getArgument(0)
330330
or
331-
this = rh.(DataFlow::FunctionNode).getAReturn()
331+
exists(RouteSetup setup |
332+
rh = setup.getARouteHandler() and
333+
this = rh.(DataFlow::FunctionNode).getAReturn() and
334+
setup.getMethodName() != "addHook"
335+
)
332336
}
333337

334338
override RouteHandler getRouteHandler() { result = rh }

0 commit comments

Comments
 (0)