public IEnumerable <DiagnosticInfo> GetDiagnosticInfo(SyntaxNodeAnalysisContext context) { var result = new List <DiagnosticInfo>(); var syntax = context.Node as InvocationExpressionSyntax; if (!_expressionSyntaxAnalyzer.IsVulnerable(context.SemanticModel, syntax)) { return(result); } result.Add(new DiagnosticInfo(syntax.GetLocation())); return(result); }
public override void GetSinks(SyntaxNodeAnalysisContext context, DiagnosticId ruleId) { var syntax = context.Node as InvocationExpressionSyntax; if (!_expressionSyntaxAnalyzer.IsVulnerable(context.SemanticModel, syntax, ruleId)) { return; } //TODO: NEEDS A CUSTOM IMPLEMENTATION TO CHECK IF PARM1 STARTS W/ A NON-TAINTED VALUE. //E.G. CONFIGSETTING + Request PARM IS OK / FALSE POSITIVE //TODO: NEEDS CLEANSE METHOD AS WELL if (VulnerableSyntaxNodes.All(p => p.Sink.GetLocation() != syntax?.GetLocation())) { VulnerableSyntaxNodes.Push(_vulnerableSyntaxNodeFactory.Create(syntax)); } }