We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1712d01 commit 407dceaCopy full SHA for 407dcea
java/ql/src/experimental/Security/CWE/CWE-348/UseOfLessTrustedSourceLib.qll
@@ -52,11 +52,13 @@ private class CompareSink extends UseOfLessTrustedSink {
52
)
53
or
54
exists(MethodAccess ma |
55
- ma.getMethod().hasName("contains") and
+ ma.getMethod().getName() in ["contains", "startsWith"] and
56
ma.getMethod().getDeclaringType() instanceof TypeString and
57
ma.getMethod().getNumberOfParameters() = 1 and
58
ma.getQualifier() = this.asExpr() and
59
- not ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in ["", "unknown"]
+ not ma.getArgument(0).(CompileTimeConstantExpr).getStringValue().toLowerCase() in [
60
+ "", "unknown"
61
+ ]
62
63
64
0 commit comments