Skip to content

Commit 786e7fd

Browse files
committed
update
1 parent b329396 commit 786e7fd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/routes/solid-start/guides/security.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ However, this protection does not apply when using [`innerHTML`](https://docs.so
1212
To protect your application from XSS attacks:
1313

1414
1. Avoid using [`innerHTML`](/reference/jsx-attributes/innerhtml-or-textcontent#innerhtml-or-textcontent) when possible.
15-
If you must use it, sanitize the content before rendering with libraries such as [DOMPurify](https://github.com/cure53/DOMPurify).
15+
If necessary, make sure to sanitize user-supplied data with libraries such as [DOMPurify](https://github.com/cure53/DOMPurify).
1616
2. Validate and sanitize user inputs.
1717
Always validate form inputs on the server in addition to the client.
1818
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.
1921

20-
We highly recommend you read [Cross Site Scripting Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html) for more guidance.
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.
2123

2224
## CSP (Content Security Policy)
2325

@@ -202,5 +204,4 @@ export default createMiddleware({
202204
This example demonstrates a basic implementation of CSRF protection that checks for the `Origin` and `Referer` headers and blocks requests that are not from trusted origins.
203205
In addition, consider implementing a more comprehensive CSRF protection mechanism such as [Double-Submit Cookie Pattern](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#alternative-using-a-double-submit-cookie-pattern).
204206

205-
We highly recommend you read [Cross-Site Request Forgery Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html) for more guidance.
206-
207+
We highly recommend reading the [Cross-Site Request Forgery Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html) for further guidance.

0 commit comments

Comments
 (0)