Skip to content

Commit 9ea8f82

Browse files
authored
Merge pull request github#5265 from erik-krogh/cacheRemote
Approved by asgerf
2 parents cee9677 + de6b604 commit 9ea8f82

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ module AccessPath {
415415
pragma[inline]
416416
DataFlow::SourceNode getAnAliasedSourceNode(DataFlow::Node node) {
417417
exists(DataFlow::SourceNode root, string accessPath |
418-
node = AccessPath::getAReferenceTo(root, accessPath) and
418+
node = pragma[only_bind_into](AccessPath::getAReferenceTo(root, accessPath)) and
419419
result = AccessPath::getAReferenceTo(root, accessPath)
420420
)
421421
or

javascript/ql/src/semmle/javascript/frameworks/Hapi.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,14 @@ module Hapi {
196196

197197
private DataFlow::SourceNode getARouteHandler(DataFlow::TypeBackTracker t) {
198198
t.start() and
199-
result = handler.flow().getALocalSource()
199+
result = getRouteHandler().getALocalSource()
200200
or
201201
exists(DataFlow::TypeBackTracker t2 | result = getARouteHandler(t2).backtrack(t2, t))
202202
}
203203

204+
pragma[noinline]
205+
private DataFlow::Node getRouteHandler() { result = handler.flow() }
206+
204207
Expr getRouteHandlerExpr() { result = handler }
205208

206209
override Expr getServer() { result = server }

javascript/ql/src/semmle/javascript/security/dataflow/RemoteFlowSources.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ import semmle.javascript.frameworks.HTTP
77
import semmle.javascript.security.dataflow.DOM
88

99
/** A data flow source of remote user input. */
10+
cached
1011
abstract class RemoteFlowSource extends DataFlow::Node {
1112
/** Gets a string that describes the type of this remote flow source. */
13+
cached
1214
abstract string getSourceType();
1315

1416
/**
1517
* Holds if this can be a user-controlled object, such as a JSON object parsed from user-controlled data.
1618
*/
19+
cached
1720
predicate isUserControlledObject() { none() }
1821
}
1922

0 commit comments

Comments
 (0)