Skip to content

Commit 51a0b6d

Browse files
committed
remove client-side remote-flow from js/resource-exhaustion
1 parent 41bdd8f commit 51a0b6d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/ResourceExhaustionCustomizations.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ module ResourceExhaustion {
2828
abstract class Sanitizer extends DataFlow::Node { }
2929

3030
/** A source of remote user input, considered as a data flow source for resource exhaustion vulnerabilities. */
31-
class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource { }
31+
class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
32+
RemoteFlowSourceAsSource() { not this instanceof ClientSideRemoteFlowSource }
33+
}
3234

3335
/**
3436
* A node that determines the repetitions of a string, considered as a data flow sink for resource exhaustion vulnerabilities.

javascript/ql/test/query-tests/Security/CWE-770/ResourceExhaustion/resource-exhaustion.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,10 @@ var server = http.createServer(function(req, res) {
9292
Buffer.alloc(n); // NOT OK - NO length check
9393
}
9494
});
95+
96+
function browser() {
97+
const delay = parseInt(window.location.search.replace('?', '')) || 5000;
98+
setTimeout(() => {
99+
console.log("f00");
100+
}, delay); // OK - source is client side
101+
}

0 commit comments

Comments
 (0)