Update the query

This commit is contained in:
luchua-bc
2021-09-24 01:48:11 +00:00
parent 2dc38aee54
commit 272e4f6cf9
4 changed files with 122 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ check on maximum allowed sleep time is enforced.</p>
<references>
<li>
snyk:
Snyk:
<a href="https://snyk.io/vuln/SNYK-JAVA-COMGOOGLECODEGWTUPLOAD-569506">Denial of Service (DoS)
in com.googlecode.gwtupload:gwtupload</a>.
</li>

View File

@@ -40,11 +40,14 @@ class InitParameterInput extends LocalUserInput {
}
private class LessThanSanitizer extends DataFlow::BarrierGuard {
LessThanSanitizer() { this instanceof LTExpr }
LessThanSanitizer() { this instanceof ComparisonExpr }
override predicate checks(Expr e, boolean branch) {
e = this.(LTExpr).getLeftOperand() and
e = this.(ComparisonExpr).getLesserOperand() and
branch = true
or
e = this.(ComparisonExpr).getGreaterOperand() and
branch = false
}
}
@@ -59,13 +62,11 @@ class ThreadResourceAbuse extends TaintTracking::Configuration {
override predicate isSink(DataFlow::Node sink) { sink instanceof PauseThreadSink }
override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
exists(ConditionalExpr ce | ce.getAChildExpr() = node1.asExpr() and ce = node2.asExpr()) // request.getParameter("nodelay") != null ? 0 : sleepTime
or
exists(
Method rm, ClassInstanceExpr ce, Argument arg, FieldAccess fa // thread.start() invokes the run() method of thread implementation
|
rm.hasName("run") and
ce.getConstructedType() = rm.getSourceDeclaration().getDeclaringType() and
ce.getConstructedType().getSourceDeclaration() = rm.getSourceDeclaration().getDeclaringType() and
ce.getConstructedType().getASupertype*().hasQualifiedName("java.lang", "Runnable") and
ce.getAnArgument() = arg and
fa = rm.getAnAccessedField().getAnAccess() and