mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Consider boxed booleans to avoid false positives for XXE.ql
This commit is contained in:
@@ -36,7 +36,10 @@ abstract class ParserConfig extends MethodAccess {
|
||||
*/
|
||||
predicate disables(Expr e) {
|
||||
this.getArgument(0) = e and
|
||||
this.getArgument(1).(BooleanLiteral).getBooleanValue() = false
|
||||
(
|
||||
this.getArgument(1).(BooleanLiteral).getBooleanValue() = false or
|
||||
this.getArgument(1).(FieldAccess).getField().hasQualifiedName("java.lang", "Boolean", "FALSE")
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +47,10 @@ abstract class ParserConfig extends MethodAccess {
|
||||
*/
|
||||
predicate enables(Expr e) {
|
||||
this.getArgument(0) = e and
|
||||
this.getArgument(1).(BooleanLiteral).getBooleanValue() = true
|
||||
(
|
||||
this.getArgument(1).(BooleanLiteral).getBooleanValue() = true or
|
||||
this.getArgument(1).(FieldAccess).getField().hasQualifiedName("java.lang", "Boolean", "TRUE")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user