File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -337,10 +337,7 @@ module NestJS {
337337 handler .isReturnValueReflected ( ) and
338338 this = handler .getAReturn ( ) and
339339 // Only returned strings are sinks. If we can find a type for the return value, it must be string-like.
340- not exists ( NameResolution:: Node type |
341- TypeResolution:: valueHasType ( this .asExpr ( ) , type ) and
342- not TypeResolution:: hasUnderlyingStringOrAnyType ( type )
343- )
340+ this .asExpr ( ) .getTypeBinding ( ) .hasUnderlyingStringOrAnyType ( )
344341 }
345342
346343 override Http:: RouteHandler getRouteHandler ( ) { result = handler }
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ class TypeNameBindingNode extends NameResolution::Node {
119119 DataFlow:: ClassNode getAnUnderlyingClass ( ) {
120120 UnderlyingTypes:: nodeHasUnderlyingClassType ( this , result )
121121 }
122+
123+ /**
124+ * Holds if this type contains `string` or `any`, possibly wrapped in a promise.
125+ */
126+ predicate hasUnderlyingStringOrAnyType ( ) { TypeResolution:: hasUnderlyingStringOrAnyType ( this ) }
122127}
123128
124129/**
You can’t perform that action at this time.
0 commit comments