|
|
|
|
|
by iamkonstantin
721 days ago
|
|
it’s unclear what point the post is trying to make. The outlined behaviour is not specific to HTMx per-se. These are security considerations for all server rendered pages. The “basic” golden rules: - Only call routes you control - Always use an auto-escaping template engine - Only serve user-generated content inside HTML tags - If you have authentication cookies, set them with Secure, HttpOnly, and SameSite=Lax https://htmx.org/essays/web-security-basics-with-htmx/ |
|
This requires templating engines to separate styles, scripts and event handlers from the html.
> These are security considerations for all server rendered pages.
That's not true. With the right CSP and sandbox rules content can be made inert without sanitizing.
Sanitizing is still a good idea of course, but a rendering engine that is designed with CSP in mind will provide more layers of defense.