mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C#: Move isRelevantMemberAccess out of PropagateToSinkConfigurationSpecific.
This commit is contained in:
@@ -107,24 +107,24 @@ string qualifierString() { result = "Argument[Qualifier]" }
|
||||
bindingset[kind]
|
||||
predicate isRelevantSinkKind(string kind) { any() }
|
||||
|
||||
private predicate isRelevantMemberAccess(DataFlow::Node node) {
|
||||
exists(CS::MemberAccess access | access = node.asExpr() |
|
||||
access.hasThisQualifier() and
|
||||
access.getTarget().isEffectivelyPublic() and
|
||||
(
|
||||
access instanceof CS::FieldAccess
|
||||
or
|
||||
access.getTarget().(CS::Property).getSetter().isPublic()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Language specific parts of the `PropagateToSinkConfiguration`.
|
||||
*/
|
||||
class PropagateToSinkConfigurationSpecific extends CS::TaintTracking::Configuration {
|
||||
PropagateToSinkConfigurationSpecific() { this = "parameters or fields flowing into sinks" }
|
||||
|
||||
private predicate isRelevantMemberAccess(DataFlow::Node node) {
|
||||
exists(CS::MemberAccess access | access = node.asExpr() |
|
||||
access.hasThisQualifier() and
|
||||
access.getTarget().isEffectivelyPublic() and
|
||||
(
|
||||
access instanceof CS::FieldAccess
|
||||
or
|
||||
access.getTarget().(CS::Property).getSetter().isPublic()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
(isRelevantMemberAccess(source) or source instanceof DataFlow::ParameterNode) and
|
||||
isRelevantForModels(source.getEnclosingCallable())
|
||||
|
||||
Reference in New Issue
Block a user