Fix, prevent addHook return values from being treated as XSS sinks

This commit is contained in:
Napalys Klicius
2025-04-28 12:21:21 +02:00
parent fdfdcc0d93
commit 8b53f8f2a6

View File

@@ -328,7 +328,11 @@ module Fastify {
ResponseSendArgument() {
this = rh.getAResponseSource().ref().getAMethodCall("send").getArgument(0)
or
this = rh.(DataFlow::FunctionNode).getAReturn()
exists(RouteSetup setup |
rh = setup.getARouteHandler() and
this = rh.(DataFlow::FunctionNode).getAReturn() and
setup.getMethodName() != "addHook"
)
}
override RouteHandler getRouteHandler() { result = rh }