Skip to content

Commit daa1ce1

Browse files
Merge branch 'main' into iss-1049
2 parents 5e6e2c6 + a5ed55d commit daa1ce1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ This can also be achieved through an `onRequest` [middleware](/solid-start/refer
2828

2929
## Cross Site Scripting (XSS)
3030

31-
SolidStart doesn't have any built-in protection against XSS attacks.
32-
Though HTML is escapbed by default when transforming JSX, it is still reliant on other security measuers (such as `Content-Security-Policy`) to prevent XSS attacks.
31+
SolidStart automatically escape inserts and attributes in HTML.
32+
The exception is when HTML is inserted via the `innerHTML` property, which bypasses the escaping.
33+
Additionally, it's important to note that `<noscript>` are also outside of the purview of SolidStart, since those tags and its contents are evaluated even without JavaScript.
34+
It is important to sanitize any strings in attributes, especially when inside `<noscript>` tags.
3335

34-
Make sure to sanitize attributes (even in `<noscript>` tags) and avoid injecting HTML into your page as much as possible.
36+
As a rule-of-thumb it is recommended to avoid injecting HTML into your page as much as possible, make sure the contents of `<noscript>` are properly sanitized, and add a strict Content Security Policy to your application.

0 commit comments

Comments
 (0)