C++: Fix CWE-611 XXE query to work with use-use dataflow

This commit is contained in:
Jeroen Ketema
2022-11-23 16:14:28 +01:00
parent 9e4cab74ec
commit 30bdd25228
2 changed files with 68 additions and 4 deletions

View File

@@ -67,8 +67,7 @@ class XercesDomParserLibrary extends XmlLibrary {
// constructor.
exists(CallInstruction call |
call.getStaticCallTarget() = any(XercesDomParserClass c).getAConstructor() and
node.asInstruction().(WriteSideEffectInstruction).getDestinationAddress() =
call.getThisArgument() and
node.asInstruction().(StoreInstruction).getSourceValue() = call.getThisArgument() and
encodeXercesFlowState(flowstate, 0, 1) // default configuration
)
}
@@ -153,8 +152,7 @@ class SaxParserLibrary extends XmlLibrary {
// constructor.
exists(CallInstruction call |
call.getStaticCallTarget() = any(SaxParserClass c).getAConstructor() and
node.asInstruction().(WriteSideEffectInstruction).getDestinationAddress() =
call.getThisArgument() and
node.asInstruction().(StoreInstruction).getSourceValue() = call.getThisArgument() and
encodeXercesFlowState(flowstate, 0, 1) // default configuration
)
}