Restrict field access to same type

This commit is contained in:
Benjamin Muskalla
2021-11-09 11:52:59 +01:00
parent 8740e879b4
commit 74ac234f1c

View File

@@ -64,8 +64,8 @@ string captureQualifierFlow(Callable api) {
string captureFieldFlow(Callable api) {
exists(FieldAccess fa, ReturnNodeExt returnNode |
not (fa.getField().isStatic() and fa.getField().isFinal()) and
fa.getField().getDeclaringType() = api.getDeclaringType() and
returnNode.getEnclosingCallable() = api and
fa.getCompilationUnit() = api.getCompilationUnit() and
isRelevantType(api.getReturnType()) and
not api.getDeclaringType() instanceof EnumType and
TaintTracking::localTaint(DataFlow::exprNode(fa), returnNode)