Skip to content

Commit 18f173c

Browse files
committed
edits
1 parent 4de2973 commit 18f173c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

aspnetcore/security/cross-site-scripting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To avoid introducing XSS into the application, developers should implement the f
4646

4747
## Explore HTML encoding with Razor
4848

49-
The Razor engine used in MVC automatically encodes all output sourced from variables, unless you work to prevent this behavior. It uses HTML attribute encoding rules whenever you use the at symbol `@` directive. Because HTML attribute encoding is a superset of HTML encoding, you don't have to consider whether to use HTML encoding or HTML-attribute encoding. You must ensure that you only use the at symbol `@` in an HTML context, and not when attempting to insert untrusted input directly into JavaScript. [Razor Tag Helpers](xref:../mvc/views/tag-helpers/intro) also encode input you use in tag parameters.
49+
The Razor engine used in MVC automatically encodes all output sourced from variables, unless you work to prevent this behavior. It uses HTML attribute encoding rules whenever you use the at symbol `@` directive. Because HTML attribute encoding is a superset of HTML encoding, you don't have to consider whether to use HTML encoding or HTML-attribute encoding. You must ensure that you only use the at symbol `@` in an HTML context, and not when attempting to insert untrusted input directly into JavaScript. [Razor Tag Helpers](xref:mvc/views/tag-helpers/intro) also encode input you use in tag parameters.
5050

5151
Consider the following Razor view:
5252

@@ -58,7 +58,7 @@ Consider the following Razor view:
5858
@untrustedInput
5959
```
6060

61-
This view outputs the contents of the `untrustedInput` variable. The variable includes some characters used in XSS attacks: left angle bracket (less than) (`<`), double quote (`"`), and right angle bracket (greater than) (`>`). Examining the source shows the rendered output encoded as:
61+
This view outputs the contents of the `untrustedInput` variable. The variable includes some characters used in XSS attacks: less than (`<`), double quote (`"`), and right angle bracket or _greater than_ (`>`). Examining the source shows the rendered output encoded as:
6262

6363
```html
6464
&lt;&quot;123&quot;&gt;
@@ -302,4 +302,4 @@ Never rely on validation alone. Always encode untrusted input before output, no
302302

303303
- <xref:fundamentals/dependency-injection>
304304
- [Unicode 17.0 Character Code Charts](https://www.unicode.org/charts/index.html)
305-
- [Razor Tag Helpers](xref:../mvc/views/tag-helpers/intro)
305+
- [Razor Tag Helpers](xref:mvc/views/tag-helpers/intro)

0 commit comments

Comments
 (0)