File tree Expand file tree Collapse file tree
java/ql/src/experimental/Security/CWE/CWE-348 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,10 +41,12 @@ private class CompareSink extends UseOfLessTrustedSink {
4141 ma .getMethod ( ) .getNumberOfParameters ( ) = 1 and
4242 (
4343 ma .getArgument ( 0 ) = this .asExpr ( ) and
44- ma .getQualifier ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName
44+ ma .getQualifier ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName and
45+ not ma .getQualifier ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "0:0:0:0:0:0:0:1"
4546 or
4647 ma .getQualifier ( ) = this .asExpr ( ) and
47- ma .getArgument ( 0 ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName
48+ ma .getArgument ( 0 ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName and
49+ not ma .getArgument ( 0 ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "0:0:0:0:0:0:0:1"
4850 )
4951 )
5052 or
@@ -79,7 +81,8 @@ private class CompareSink extends UseOfLessTrustedSink {
7981 .hasQualifiedName ( [ "org.apache.commons.lang3" , "org.apache.commons.lang" ] , "StringUtils" ) and
8082 ma .getMethod ( ) .getNumberOfParameters ( ) = 2 and
8183 ma .getAnArgument ( ) = this .asExpr ( ) and
82- ma .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName
84+ ma .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) instanceof PrivateHostName and
85+ not ma .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "0:0:0:0:0:0:0:1"
8386 )
8487 }
8588}
You can’t perform that action at this time.
0 commit comments