C#: Validate all access paths except for Field and Property.

This commit is contained in:
Michael Nebel
2023-03-21 11:08:33 +01:00
parent 46ef954d5c
commit 71d184e8c0
3 changed files with 21 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
import csharp
import semmle.code.csharp.dataflow.ExternalFlow
import semmle.code.csharp.dataflow.internal.AccessPathSyntax
import ModelValidation
private predicate getRelevantAccessPath(string path) {
summaryModel(_, _, _, _, _, _, path, _, _, _) or
summaryModel(_, _, _, _, _, _, _, path, _, _) or
sinkModel(_, _, _, _, _, _, path, _, _) or
sourceModel(_, _, _, _, _, _, path, _, _)
}
private class AccessPathsExternal extends AccessPath::Range {
AccessPathsExternal() { getRelevantAccessPath(this) }
}