You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routes/solid-start/guides/security.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ However, this protection does not apply when using [`innerHTML`](https://docs.so
11
11
12
12
To protect your application from XSS attacks:
13
13
14
-
1. Avoid using [`innerHTML`](/reference/jsx-attributes/innerhtml-or-textcontent#innerhtml-or-textcontent) when possible.
15
-
If necessary, make sure to sanitize user-supplied data with libraries such as [DOMPurify](https://github.com/cure53/DOMPurify).
16
-
2. Validate and sanitize user inputs.
17
-
Always validate form inputs on the server in addition to the client.
18
-
3. Set a Content Security Policy (CSP).
19
-
4. Sanitize attributes containing user-supplied data within `<noscript>` elements.
20
-
This includes both the attributes of the `<noscript>` element itself and its children.
14
+
- Avoid using [`innerHTML`](/reference/jsx-attributes/innerhtml-or-textcontent#innerhtml-or-textcontent) when possible.
15
+
If necessary, make sure to sanitize user-supplied data with libraries such as [DOMPurify](https://github.com/cure53/DOMPurify).
16
+
- Validate and sanitize user inputs.
17
+
Always validate form inputs on the server in addition to the client.
18
+
- Set a Content Security Policy (CSP).
19
+
- Sanitize attributes containing user-supplied data within `<noscript>` elements.
20
+
This includes both the attributes of the `<noscript>` element itself and its children.
21
21
22
22
We highly recommend reading the [Cross Site Scripting Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html) for further guidance.
0 commit comments