-
Notifications
You must be signed in to change notification settings - Fork 457
/
Microsoft.NetCore.Analyzers.sarif
2137 lines (2137 loc) · 94.7 KB
/
Microsoft.NetCore.Analyzers.sarif
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json.schemastore.org/sarif-1.0.0",
"version": "1.0.0",
"runs": [
{
"tool": {
"name": "Microsoft.NetCore.Analyzers",
"version": "2.9.5",
"language": "en-US"
},
"rules": {
"CA1303": {
"id": "CA1303",
"shortDescription": "Do not pass literals as localized parameters",
"fullDescription": "A method passes a string literal as a parameter to a constructor or method in the .NET Framework class library and that string should be localizable. To fix a violation of this rule, replace the string literal with a string retrieved through an instance of the ResourceManager class.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1303-do-not-pass-literals-as-localized-parameters",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "DoNotPassLiteralsAsLocalizedParameters",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Dataflow",
"Telemetry"
]
}
},
"CA1304": {
"id": "CA1304",
"shortDescription": "Specify CultureInfo",
"fullDescription": "A method or constructor calls a member that has an overload that accepts a System.Globalization.CultureInfo parameter, and the method or constructor does not call the overload that takes the CultureInfo parameter. When a CultureInfo or System.IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1304-specify-cultureinfo",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "SpecifyCultureInfoAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1305": {
"id": "CA1305",
"shortDescription": "Specify IFormatProvider",
"fullDescription": "A method or constructor calls one or more members that have overloads that accept a System.IFormatProvider parameter, and the method or constructor does not call the overload that takes the IFormatProvider parameter. When a System.Globalization.CultureInfo or IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be based on the input from/output displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider'. Otherwise, if the result will be stored and accessed by software, such as when it is loaded from disk/database and when it is persisted to disk/database, specify 'CultureInfo.InvariantCulture'",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1305-specify-iformatprovider",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "SpecifyIFormatProviderAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1307": {
"id": "CA1307",
"shortDescription": "Specify StringComparison",
"fullDescription": "A string comparison operation uses a method overload that does not set a StringComparison parameter. If the result will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1307-specify-stringcomparison",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "SpecifyStringComparisonAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1308": {
"id": "CA1308",
"shortDescription": "Normalize strings to uppercase",
"fullDescription": "Strings should be normalized to uppercase. A small group of characters cannot make a round trip when they are converted to lowercase. To make a round trip means to convert the characters from one locale to another locale that represents character data differently, and then to accurately retrieve the original characters from the converted characters.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1308-normalize-strings-to-uppercase",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "NormalizeStringsToUppercaseAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1401": {
"id": "CA1401",
"shortDescription": "P/Invokes should not be visible",
"fullDescription": "A public or protected method in a public type has the System.Runtime.InteropServices.DllImportAttribute attribute (also implemented by the Declare keyword in Visual Basic). Such methods should not be exposed.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1401-p-invokes-should-not-be-visible",
"properties": {
"category": "Interoperability",
"isEnabledByDefault": true,
"typeName": "PInvokeDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1813": {
"id": "CA1813",
"shortDescription": "Avoid unsealed attributes",
"fullDescription": "The .NET Framework class library provides methods for retrieving custom attributes. By default, these methods search the attribute inheritance hierarchy. Sealing the attribute eliminates the search through the inheritance hierarchy and can improve performance.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1813-avoid-unsealed-attributes",
"properties": {
"category": "Performance",
"isEnabledByDefault": false,
"typeName": "AvoidUnsealedAttributesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1816": {
"id": "CA1816",
"shortDescription": "Dispose methods should call SuppressFinalize",
"fullDescription": "A method that is an implementation of Dispose does not call GC.SuppressFinalize; or a method that is not an implementation of Dispose calls GC.SuppressFinalize; or a method calls GC.SuppressFinalize and passes something other than this (Me in Visual?Basic).",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1816-call-gc-suppressfinalize-correctly",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "CallGCSuppressFinalizeCorrectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1820": {
"id": "CA1820",
"shortDescription": "Test for empty strings using string length",
"fullDescription": "Comparing strings by using the String.Length property or the String.IsNullOrEmpty method is significantly faster than using Equals.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1820-test-for-empty-strings-using-string-length",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "TestForEmptyStringsUsingStringLengthAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1826": {
"id": "CA1826",
"shortDescription": "Do not use Enumerable methods on indexable collections. Instead use the collection directly",
"fullDescription": "This collection is directly indexable. Going through LINQ here causes unnecessary allocations and CPU work.",
"defaultLevel": "warning",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Telemetry"
]
}
},
"CA1827": {
"id": "CA1827",
"shortDescription": "Do not use Count() or LongCount() when Any() can be used",
"fullDescription": "For non-empty collections, Count() and LongCount() enumerate the entire sequence, while Any() stops at the first item or the first item that satisfies a condition.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1827",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "DoNotUseCountWhenAnyCanBeUsedAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA1828": {
"id": "CA1828",
"shortDescription": "Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used",
"fullDescription": "For non-empty collections, CountAsync() and LongCountAsync() enumerate the entire sequence, while AnyAsync() stops at the first item or the first item that satisfies a condition.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1828",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "DoNotUseCountWhenAnyCanBeUsedAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2000": {
"id": "CA2000",
"shortDescription": "Dispose objects before losing scope",
"fullDescription": "If a disposable object is not explicitly disposed before all references to it are out of scope, the object will be disposed at some indeterminate time when the garbage collector runs the finalizer of the object. Because an exceptional event might occur that will prevent the finalizer of the object from running, the object should be explicitly disposed instead.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2000-dispose-objects-before-losing-scope",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "DisposeObjectsBeforeLosingScope",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Dataflow",
"Telemetry"
]
}
},
"CA2002": {
"id": "CA2002",
"shortDescription": "Do not lock on objects with weak identity",
"fullDescription": "An object is said to have a weak identity when it can be directly accessed across application domain boundaries. A thread that tries to acquire a lock on an object that has a weak identity can be blocked by a second thread in a different application domain that has a lock on the same object.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2002-do-not-lock-on-objects-with-weak-identity",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "DoNotLockOnObjectsWithWeakIdentityAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2008": {
"id": "CA2008",
"shortDescription": "Do not create tasks without passing a TaskScheduler",
"fullDescription": "Do not create tasks unless you are using one of the overloads that takes a TaskScheduler. The default is to schedule on TaskScheduler.Current, which would lead to deadlocks. Either use TaskScheduler.Default to schedule on the thread pool, or explicitly pass TaskScheduler.Current to make your intentions clear.",
"defaultLevel": "warning",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "DoNotCreateTasksWithoutPassingATaskSchedulerAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Telemetry"
]
}
},
"CA2009": {
"id": "CA2009",
"shortDescription": "Do not call ToImmutableCollection on an ImmutableCollection value",
"fullDescription": "Do not call {0} on an {1} value",
"defaultLevel": "warning",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Telemetry"
]
}
},
"CA2100": {
"id": "CA2100",
"shortDescription": "Review SQL queries for security vulnerabilities",
"fullDescription": "SQL queries that directly use user input can be vulnerable to SQL injection attacks. Review this SQL query for potential vulnerabilities, and consider using a parameterized SQL query.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2100-review-sql-queries-for-security-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": true,
"typeName": "ReviewSqlQueriesForSecurityVulnerabilities",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Dataflow",
"Telemetry"
]
}
},
"CA2101": {
"id": "CA2101",
"shortDescription": "Specify marshaling for P/Invoke string arguments",
"fullDescription": "A platform invoke member allows partially trusted callers, has a string parameter, and does not explicitly marshal the string. This can cause a potential security vulnerability.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2101-specify-marshaling-for-p-invoke-string-arguments",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "PInvokeDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2208": {
"id": "CA2208",
"shortDescription": "Instantiate argument exceptions correctly",
"fullDescription": "A call is made to the default (parameterless) constructor of an exception type that is or derives from ArgumentException, or an incorrect string argument is passed to a parameterized constructor of an exception type that is or derives from ArgumentException.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2208-instantiate-argument-exceptions-correctly",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "InstantiateArgumentExceptionsCorrectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2213": {
"id": "CA2213",
"shortDescription": "Disposable fields should be disposed",
"fullDescription": "A type that implements System.IDisposable declares fields that are of types that also implement IDisposable. The Dispose method of the field is not called by the Dispose method of the declaring type. To fix a violation of this rule, call Dispose on fields that are of types that implement IDisposable if you are responsible for allocating and releasing the unmanaged resources held by the field.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2213-disposable-fields-should-be-disposed",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "DisposableFieldsShouldBeDisposed",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Dataflow",
"Telemetry"
]
}
},
"CA2216": {
"id": "CA2216",
"shortDescription": "Disposable types should declare finalizer",
"fullDescription": "A type that implements System.IDisposable and has fields that suggest the use of unmanaged resources does not implement a finalizer, as described by Object.Finalize.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2216-disposable-types-should-declare-finalizer",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "DisposableTypesShouldDeclareFinalizerAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2229": {
"id": "CA2229",
"shortDescription": "Implement serialization constructors",
"fullDescription": "To fix a violation of this rule, implement the serialization constructor. For a sealed class, make the constructor private; otherwise, make it protected.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2229-implement-serialization-constructors",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "SerializationRulesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2235": {
"id": "CA2235",
"shortDescription": "Mark all non-serializable fields",
"fullDescription": "An instance field of a type that is not serializable is declared in a type that is serializable.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2235-mark-all-non-serializable-fields",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "SerializationRulesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2237": {
"id": "CA2237",
"shortDescription": "Mark ISerializable types with serializable",
"fullDescription": "To be recognized by the common language runtime as serializable, types must be marked by using the SerializableAttribute attribute even when the type uses a custom serialization routine through implementation of the ISerializable interface.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2237-mark-iserializable-types-with-serializableattribute",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "SerializationRulesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2241": {
"id": "CA2241",
"shortDescription": "Provide correct arguments to formatting methods",
"fullDescription": "The format argument that is passed to System.String.Format does not contain a format item that corresponds to each object argument, or vice versa.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2241-provide-correct-arguments-to-formatting-methods",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "ProvideCorrectArgumentsToFormattingMethodsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2242": {
"id": "CA2242",
"shortDescription": "Test for NaN correctly",
"fullDescription": "This expression tests a value against Single.Nan or Double.Nan. Use Single.IsNan(Single) or Double.IsNan(Double) to test the value.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2242-test-for-nan-correctly",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "TestForNaNCorrectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2243": {
"id": "CA2243",
"shortDescription": "Attribute string literals should parse correctly",
"fullDescription": "The string literal parameter of an attribute does not parse correctly for a URL, a GUID, or a version.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2243-attribute-string-literals-should-parse-correctly",
"properties": {
"category": "Usage",
"isEnabledByDefault": true,
"typeName": "AttributeStringLiteralsShouldParseCorrectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA2300": {
"id": "CA2300",
"shortDescription": "Do not use insecure deserializer BinaryFormatter",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data. If you need to instead detect BinaryFormatter deserialization without a SerializationBinder set, then disable rule CA2300, and enable rules CA2301 and CA2302.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2300-do-not-use-insecure-deserializer-binaryformatter",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerBinaryFormatterMethods",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2301": {
"id": "CA2301",
"shortDescription": "Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data without a SerializationBinder to restrict the type of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2301-do-not-call-binaryformatter-deserialize-without-first-setting-binaryformatter-binder",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerBinaryFormatterWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2302": {
"id": "CA2302",
"shortDescription": "Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data without a SerializationBinder to restrict the type of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2302-ensure-binaryformatter-binder-is-set-before-calling-binaryformatter-deserialize",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerBinaryFormatterWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2305": {
"id": "CA2305",
"shortDescription": "Do not use insecure deserializer LosFormatter",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2305-do-not-use-insecure-deserializer-losformatter",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerLosFormatter",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2310": {
"id": "CA2310",
"shortDescription": "Do not use insecure deserializer NetDataContractSerializer",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data. If you need to instead detect NetDataContractSerializer deserialization without a SerializationBinder set, then disable rule CA2310, and enable rules CA2311 and CA2312.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2310-do-not-use-insecure-deserializer-netdatacontractserializer",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerNetDataContractSerializerMethods",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2311": {
"id": "CA2311",
"shortDescription": "Do not deserialize without first setting NetDataContractSerializer.Binder",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data without a SerializationBinder to restrict the type of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2311-do-not-deserialize-without-first-setting-netdatacontractserializer-binder",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerNetDataContractSerializerWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2312": {
"id": "CA2312",
"shortDescription": "Ensure NetDataContractSerializer.Binder is set before deserializing",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data without a SerializationBinder to restrict the type of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2312-ensure-netdatacontractserializer-binder-is-set-before-deserializing",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerNetDataContractSerializerWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2315": {
"id": "CA2315",
"shortDescription": "Do not use insecure deserializer ObjectStateFormatter",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2315-do-not-use-insecure-deserializer-objectstateformatter",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerObjectStateFormatter",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2321": {
"id": "CA2321",
"shortDescription": "Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data with a JavaScriptSerializer initialized with a SimpleTypeResolver. Initialize JavaScriptSerializer without a JavaScriptTypeResolver specified, or initialize with a JavaScriptTypeResolver that limits the types of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2321",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerJavaScriptSerializerWithSimpleTypeResolver",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2322": {
"id": "CA2322",
"shortDescription": "Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing",
"fullDescription": "The method '{0}' is insecure when deserializing untrusted data with a JavaScriptSerializer initialized with a SimpleTypeResolver. Ensure that the JavaScriptSerializer is initialized without a JavaScriptTypeResolver specified, or initialized with a JavaScriptTypeResolver that limits the types of objects in the deserialized object graph.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2322",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerJavaScriptSerializerWithSimpleTypeResolver",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2326": {
"id": "CA2326",
"shortDescription": "Do not use TypeNameHandling values other than None",
"fullDescription": "Deserializing JSON when using a TypeNameHandling value other than None can be insecure. If you need to instead detect Json.NET deserialization when a SerializationBinder isn't specified, then disable rule CA2326, and enable rules CA2327, CA2328, CA2329, and CA2330.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2326",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "JsonNetTypeNameHandling",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA2327": {
"id": "CA2327",
"shortDescription": "Do not use insecure JsonSerializerSettings",
"fullDescription": "When deserializing untrusted input, allowing arbitrary types to be deserialized is insecure. When using JsonSerializerSettings, use TypeNameHandling.None, or for values other than None, restrict deserialized types with a SerializationBinder.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2327",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureSettingsForJsonNet",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2328": {
"id": "CA2328",
"shortDescription": "Ensure that JsonSerializerSettings are secure",
"fullDescription": "When deserializing untrusted input, allowing arbitrary types to be deserialized is insecure. When using JsonSerializerSettings, ensure TypeNameHandling.None is specified, or for values other than None, ensure a SerializationBinder is specified to restrict deserialized types.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2328",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureSettingsForJsonNet",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2329": {
"id": "CA2329",
"shortDescription": "Do not deserialize with JsonSerializer using an insecure configuration",
"fullDescription": "When deserializing untrusted input, allowing arbitrary types to be deserialized is insecure. When using deserializing JsonSerializer, use TypeNameHandling.None, or for values other than None, restrict deserialized types with a SerializationBinder.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2329",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerJsonNetWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA2330": {
"id": "CA2330",
"shortDescription": "Ensure that JsonSerializer has a secure configuration when deserializing",
"fullDescription": "When deserializing untrusted input, allowing arbitrary types to be deserialized is insecure. When using deserializing JsonSerializer, use TypeNameHandling.None, or for values other than None, restrict deserialized types with a SerializationBinder.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca2330",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "DoNotUseInsecureDeserializerJsonNetWithoutBinder",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA3001": {
"id": "CA3001",
"shortDescription": "Review code for SQL injection vulnerabilities",
"fullDescription": "Potential SQL injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3001-review-code-for-sql-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForSqlInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3002": {
"id": "CA3002",
"shortDescription": "Review code for XSS vulnerabilities",
"fullDescription": "Potential cross-site scripting (XSS) vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3002-review-code-for-xss-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForXssVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3003": {
"id": "CA3003",
"shortDescription": "Review code for file path injection vulnerabilities",
"fullDescription": "Potential file path injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3003-review-code-for-file-path-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForFilePathInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3004": {
"id": "CA3004",
"shortDescription": "Review code for information disclosure vulnerabilities",
"fullDescription": "Potential information disclosure vulnerability was found where '{0}' in method '{1}' may contain unintended information from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3004-review-code-for-information-disclosure-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForInformationDisclosureVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3005": {
"id": "CA3005",
"shortDescription": "Review code for LDAP injection vulnerabilities",
"fullDescription": "Potential LDAP injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3005-review-code-for-ldap-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForLdapInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3006": {
"id": "CA3006",
"shortDescription": "Review code for process command injection vulnerabilities",
"fullDescription": "Potential process command injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3006-review-code-for-process-command-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForCommandExecutionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3007": {
"id": "CA3007",
"shortDescription": "Review code for open redirect vulnerabilities",
"fullDescription": "Potential open redirect vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3007-review-code-for-open-redirect-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForOpenRedirectVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3008": {
"id": "CA3008",
"shortDescription": "Review code for XPath injection vulnerabilities",
"fullDescription": "Potential XPath injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3008-review-code-for-xpath-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForXPathInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3009": {
"id": "CA3009",
"shortDescription": "Review code for XML injection vulnerabilities",
"fullDescription": "Potential XML injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3009-review-code-for-xml-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForXmlInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3010": {
"id": "CA3010",
"shortDescription": "Review code for XAML injection vulnerabilities",
"fullDescription": "Potential XAML injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3010-review-code-for-xaml-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForXamlInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3011": {
"id": "CA3011",
"shortDescription": "Review code for DLL injection vulnerabilities",
"fullDescription": "Potential DLL injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca3011-review-code-for-dll-injection-vulnerabilities",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "ReviewCodeForDllInjectionVulnerabilities",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA3012": {
"id": "CA3012",
"shortDescription": "Review code for regex injection vulnerabilities",
"fullDescription": "Potential regex injection vulnerability was found where '{0}' in method '{1}' may be tainted by user-controlled data from '{2}' in method '{3}'.",