mention HTML sanitization as deprecated approach (#8800)
Include some content from https://github.com/aspnet/Docs/issues/7962#issuecomment-410779470 that would be helpful to those who search for this topic.pull/8810/head
parent
c84d142185
commit
79e90ea1b7
|
@ -3,7 +3,7 @@ title: Prevent Cross-Site Scripting (XSS) in ASP.NET Core
|
|||
author: rick-anderson
|
||||
description: Learn about Cross-Site Scripting (XSS) and techniques for addressing this vulnerability in an ASP.NET Core app.
|
||||
ms.author: riande
|
||||
ms.date: 10/14/2016
|
||||
ms.date: 10/02/2018
|
||||
uid: security/cross-site-scripting
|
||||
---
|
||||
# Prevent Cross-Site Scripting (XSS) in ASP.NET Core
|
||||
|
@ -219,4 +219,4 @@ The general accepted practice is that encoding takes place at the point of outpu
|
|||
|
||||
## Validation as an XSS prevention technique
|
||||
|
||||
Validation can be a useful tool in limiting XSS attacks. For example, a numeric string containing only the characters 0-9 won't trigger an XSS attack. Validation becomes more complicated should you wish to accept HTML in user input - parsing HTML input is difficult, if not impossible. MarkDown and other text formats would be a safer option for rich input. You should never rely on validation alone. Always encode untrusted input before output, no matter what validation you have performed.
|
||||
Validation can be a useful tool in limiting XSS attacks. For example, a numeric string containing only the characters 0-9 won't trigger an XSS attack. Validation becomes more complicated when accepting HTML in user input. Parsing HTML input is difficult, if not impossible. Markdown, coupled with a parser that strips embedded HTML, is a safer option for accepting rich input. Never rely on validation alone. Always encode untrusted input before output, no matter what validation or sanitization has been performed.
|
||||
|
|
Loading…
Reference in New Issue