Skip to content

Commit 00e512b

Browse files
authored
Merge branch 'master' into ca5366
2 parents d3a60eb + 0fbb6d7 commit 00e512b

File tree

6 files changed

+84
-4
lines changed

6 files changed

+84
-4
lines changed

docs/code-quality/ca5365.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: "CA5365: Do Not Disable HTTP Header Checking"
3+
description: Provides information about code analysis rule CA5365, including causes, how to fix violations, and when to suppress it.
4+
ms.date: 04/29/2020
5+
ms.topic: reference
6+
author: LLLXXXCCC
7+
ms.author: linche
8+
manager: jillfra
9+
ms.workload:
10+
- "multiple"
11+
f1_keywords:
12+
- "CA5365"
13+
---
14+
# CA5364: Do Not Disable HTTP Header Checking
15+
16+
|||
17+
|-|-|
18+
|CheckId|CA5365|
19+
|Category|Microsoft.Security|
20+
|Breaking change|Non-breaking|
21+
22+
## Cause
23+
24+
Set <xref:System.Web.Configuration.HttpRuntimeSection.EnableHeaderChecking> to false.
25+
26+
## Rule description
27+
28+
HTTP header checking enables encoding of the carriage return and newline characters, \r and \n, that are found in response headers. This encoding can help to avoid injection attacks that exploit an application that echoes untrusted data contained in the header.
29+
30+
## How to fix violations
31+
32+
Set <xref:System.Web.Configuration.HttpRuntimeSection.EnableHeaderChecking> to true. Or, remove the assignment to false because the default value is true.
33+
34+
## When to suppress warnings
35+
36+
HTTP header continuations rely on headers spanning multiple lines and require new lines in them. If you need to use header continuations, you need to set the <xref:System.Web.Configuration.HttpRuntimeSection.EnableHeaderChecking> property to false. There is a performance impact from checking the headers. If you are certain you are already doing the right checks, turning off this feature can improve the performance of your application. Before you disable this feature, be sure you are already taking the right precautions in this area.
37+
38+
## Pseudo-code examples
39+
40+
```csharp
41+
using System;
42+
using System.Web.Configuration;
43+
44+
class TestClass
45+
{
46+
public void TestMethod()
47+
{
48+
HttpRuntimeSection httpRuntimeSection = new HttpRuntimeSection();
49+
httpRuntimeSection.EnableHeaderChecking = false;
50+
}
51+
}
52+
```
53+
54+
### Solution
55+
56+
```csharp
57+
using System;
58+
using System.Web.Configuration;
59+
60+
class TestClass
61+
{
62+
public void TestMethod()
63+
{
64+
HttpRuntimeSection httpRuntimeSection = new HttpRuntimeSection();
65+
httpRuntimeSection.EnableHeaderChecking = true;
66+
}
67+
}
68+
```

docs/code-quality/code-analysis-warnings-for-managed-code-by-checkid.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,5 +540,6 @@ The following table lists Code Analysis warnings for managed code by the CheckId
540540
| CA2245 | [CA2245: Do not assign a property to itself](../code-quality/ca2245.md) | A property was accidentally assigned to itself. |
541541
| CA2246 | [CA2246: Do not assign a symbol and its member in the same statement](../code-quality/ca2246.md) | Assigning a symbol and its member, that is, a field or a property, in the same statement is not recommended. It is not clear if the member access was intended to use the symbol's old value prior to the assignment or the new value from the assignment in this statement. |
542542
| CA5122 | [CA5122 P/Invoke declarations should not be safe critical](../code-quality/ca5122.md) | Methods are marked as SecuritySafeCritical when they perform a security sensitive operation, but are also safe to be used by transparent code. Transparent code may never directly call native code through a P/Invoke. Therefore, marking a P/Invoke as security safe critical will not enable transparent code to call it, and is misleading for security analysis. |
543+
| CA5365 | [CA5365 Do Not Disable HTTP Header Checking](../code-quality/ca5365.md) | HTTP header checking enables encoding of the carriage return and newline characters, \r and \n, that are found in response headers. This encoding can help to avoid injection attacks that exploit an application that echoes untrusted data contained by the header. |
543544
| CA5366 | [CA5366 Use XmlReader For DataSet Read XML](../code-quality/ca5366.md) | Using a <xref:System.Data.DataSet> to read XML with untrusted data may load dangerous external references, which should be restricted by using an <xref:System.Xml.XmlReader> with a secure resolver or with DTD processing disabled. |
544545
| CA5374 | [CA5374 Do Not Use XslTransform](../code-quality/ca5374.md) | This rule checks if <xref:System.Xml.Xsl.XslTransform?displayProperty=nameWithType> is instantiated in the code. <xref:System.Xml.Xsl.XslTransform?displayProperty=nameWithType> is now obsolete and shouldn’t be used. |

docs/code-quality/install-fxcop-analyzers.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ Use the following guidelines to determine which version of the FxCop analyzers p
6666

6767
| Visual Studio version | FxCop analyzer package version |
6868
| - | - |
69-
| Visual Studio 2019 (all versions)<br />Visual Studio 2017 version 15.8 and later | [latest](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/) |
70-
| Visual Studio 2017 version 15.5 to 15.7 | [2.6.3](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.6.3) |
69+
| Visual Studio 2019 (all versions) | [latest](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/) |
70+
| Visual Studio 2017 version 15.9 | [2.9.9](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.9.9) |
71+
| Visual Studio 2017 version 15.5 to 15.8 | [2.6.4](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.6.4) |
7172
| Visual Studio 2017 version 15.3 to 15.4 | [2.3.0-beta1](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.3.0-beta1) |
7273
| Visual Studio 2017 version 15.0 to 15.2 | [2.0.0-beta2](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/2.0.0-beta2) |
7374
| Visual Studio 2015 update 2 and 3 | [1.2.0-beta2](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers/1.2.0-beta2) |

docs/code-quality/security-warnings.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Security warnings support safer libraries and applications. These warnings help
103103
|[CA5361: Do not disable SChannel use of strong crypto](../code-quality/ca5361.md)|Setting `Switch.System.Net.DontEnableSchUseStrongCrypto` to `true` weakens the cryptography used in outgoing Transport Layer Security (TLS) connections. Weaker cryptography can compromise the confidentiality of communication between your application and the server, making it easier for attackers to eavesdrop sensitive data.|
104104
|[CA5363: Do not disable request validation](../code-quality/ca5363.md)|Request validation is a feature in ASP.NET that examines HTTP requests and determines whether they contain potentially dangerous content that can lead to injection attacks, including cross-site-scripting.|
105105
|[CA5364: Do not use deprecated security protocols](../code-quality/ca5364.md)|Transport Layer Security (TLS) secures communication between computers, most commonly with Hypertext Transfer Protocol Secure (HTTPS). Older protocol versions of TLS are less secure than TLS 1.2 and TLS 1.3 and are more likely to have new vulnerabilities. Avoid older protocol versions to minimize risk.|
106+
|[CA5365: Do Not Disable HTTP Header Checking](../code-quality/ca5365.md)|HTTP header checking enables encoding of the carriage return and newline characters, \r and \n, that are found in response headers. This encoding can help to avoid injection attacks that exploit an application that echoes untrusted data contained by the header.|
106107
|[CA5366: Use XmlReader For DataSet Read XML](../code-quality/ca5366.md)|Using a <xref:System.Data.DataSet> to read XML with untrusted data may load dangerous external references, which should be restricted by using an <xref:System.Xml.XmlReader> with a secure resolver or with DTD processing disabled.|
107108
|[CA5369: Use XmlReader for Deserialize](../code-quality/ca5369.md)|Processing untrusted DTD and XML schemas may enable loading dangerous external references, which should be restricted by using an XmlReader with a secure resolver or with DTD and XML inline schema processing disabled.|
108109
|[CA5370: Use XmlReader for validating reader](../code-quality/ca5370.md)|Processing untrusted DTD and XML schemas may enable loading dangerous external references. This dangerous loading can be restricted by using an XmlReader with a secure resolver or with DTD and XML inline schema processing disabled.|
@@ -115,5 +116,5 @@ Security warnings support safer libraries and applications. These warnings help
115116
|[CA5381: Ensure certificates are not added to root store](../code-quality/ca5381.md)|This rule detects code that potentially adds a certificate into the Trusted Root Certification Authorities certificate store. By default, the Trusted Root Certification Authorities certificate store is configured with a set of public certification authorities (CAs) that has met the requirements of the Microsoft Root Certificate Program.|
116117
|[CA5386: Avoid hardcoding SecurityProtocolType value](../code-quality/ca5386.md)|Transport Layer Security (TLS) secures communication between computers, most commonly with Hypertext Transfer Protocol Secure (HTTPS). Protocol versions TLS 1.0 and TLS 1.1 are deprecated, while TLS 1.2 and TLS 1.3 are current. In the future, TLS 1.2 and TLS 1.3 may be deprecated. To ensure that your application remains secure, avoid hardcoding a protocol version and target at least .NET Framework v4.7.1.|
117118
|[CA5389: Do not add archive item's path to the target file system path](../code-quality/ca5389.md)|File path can be relative and can lead to file system access outside of the expected file system target path, leading to malicious config changes and remote code execution via lay-and-wait technique.|
118-
|[CA5397: Do not use deprecated SslProtocols values](../code-quality/ca5397.md)|ransport Layer Security (TLS) secures communication between computers, most commonly with Hypertext Transfer Protocol Secure (HTTPS). Older protocol versions of TLS are less secure than TLS 1.2 and TLS 1.3 and are more likely to have new vulnerabilities. Avoid older protocol versions to minimize risk.|
119+
|[CA5397: Do not use deprecated SslProtocols values](../code-quality/ca5397.md)|Transport Layer Security (TLS) secures communication between computers, most commonly with Hypertext Transfer Protocol Secure (HTTPS). Older protocol versions of TLS are less secure than TLS 1.2 and TLS 1.3 and are more likely to have new vulnerabilities. Avoid older protocol versions to minimize risk.|
119120
|[CA5398: Avoid hardcoded SslProtocols values](../code-quality/ca5398.md)|Transport Layer Security (TLS) secures communication between computers, most commonly with Hypertext Transfer Protocol Secure (HTTPS). Protocol versions TLS 1.0 and TLS 1.1 are deprecated, while TLS 1.2 and TLS 1.3 are current. In the future, TLS 1.2 and TLS 1.3 may be deprecated. To ensure that your application remains secure, avoid hardcoding a protocol version.|

docs/code-quality/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@
752752
href: ca5363.md
753753
- name: "CA5364: Do not use deprecated security protocols"
754754
href: ca5364.md
755+
- name: "CA5365: Do Not Disable HTTP Header Checking"
756+
href: ca5365.md
755757
- name: "CA5366: Use XmlReader For DataSet Read XML"
756758
href: ca5366.md
757759
- name: "CA5369: Use XmlReader for Deserialize"

docs/install/uninstall-visual-studio.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Uninstall Visual Studio
33
titleSuffix: ''
44
description: Learn how to uninstall Visual Studio, step-by-step.
5-
ms.date: 12/19/2019
5+
ms.date: 05/06/2020
66
ms.custom: seodec18
77
ms.topic: conceptual
88
f1_keywords:
@@ -24,6 +24,13 @@ This page walks you through uninstalling Visual Studio, our integrated suite of
2424
> [!NOTE]
2525
> This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see [Uninstall Visual Studio for Mac](/visualstudio/mac/uninstall).
2626
27+
> [!TIP]
28+
> If you're having trouble with your instance of Visual Studio, try the **Repair** tool. For more information, see [Repair Visual Studio](../install/repair-visual-studio.md).
29+
>
30+
> If you want to change the location for some of your Visual Studio files, it's possible to do so without uninstalling your current instance. For more information, see [Select the installation locations in Visual Studio](../install/change-installation-locations.md).
31+
>
32+
> For general troubleshooting tips, see [Troubleshoot Visual Studio installation and upgrade issues](../install/troubleshooting-installation-issues.md).
33+
2734
::: moniker range="vs-2017"
2835

2936
1. Find the Visual Studio Installer on your computer.

0 commit comments

Comments
 (0)