-
Notifications
You must be signed in to change notification settings - Fork 470
/
Copy pathDoNotAddArchiveItemPathToTheTargetFileSystemPath.cs
28 lines (24 loc) · 1.5 KB
/
DoNotAddArchiveItemPathToTheTargetFileSystemPath.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Analyzer.Utilities;
using Analyzer.Utilities.FlowAnalysis.Analysis.TaintedDataAnalysis;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.NetCore.Analyzers.Security.Helpers;
namespace Microsoft.NetCore.Analyzers.Security
{
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public class DoNotAddArchiveItemPathToTheTargetFileSystemPath : SourceTriggeredTaintedDataAnalyzerBase
{
internal static DiagnosticDescriptor Rule = SecurityHelpers.CreateDiagnosticDescriptor(
"CA5389",
typeof(SystemSecurityCryptographyResources),
nameof(SystemSecurityCryptographyResources.DoNotAddArchiveItemPathToTheTargetFileSystemPath),
nameof(SystemSecurityCryptographyResources.DoNotAddArchiveItemPathToTheTargetFileSystemPathMessage),
DiagnosticHelpers.EnabledByDefaultIfNotBuildingVSIX,
helpLinkUri: null,
descriptionResourceStringName: nameof(SystemSecurityCryptographyResources.DoNotAddArchiveItemPathToTheTargetFileSystemPathDescription),
customTags: WellKnownDiagnosticTagsExtensions.DataflowAndTelemetry);
protected override SinkKind SinkKind { get { return SinkKind.ZipSlip; } }
protected override DiagnosticDescriptor TaintedDataEnteringSinkDescriptor { get { return Rule; } }
}
}