From 35eca4eb59189e98b6c7031378ae4c53f1fe8d37 Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:41:27 +0200 Subject: [PATCH] Improved security section Clarified how a CSP may not be enough to secure user content and why `hx-disable` is relevant. --- www/docs.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/www/docs.md b/www/docs.md index 74e58b09..c0bfb7f1 100644 --- a/www/docs.md +++ b/www/docs.md @@ -907,18 +907,14 @@ htmx allows you to define logic directly in your DOM. This has a number of adva largest being [Locality of Behavior](https://htmx.org/essays/locality-of-behaviour/) making your system more coherent. -One concern with this approach, however, is security. This is especially the case if you are injecting user-created +One concern with this approach, however, is security. This is especially the case if you are injecting user-created content into your site without any sort of HTML escaping discipline. -You should, of course, escape all 3rd party untrusted content that is injected into your site to prevent, among other -issues, [XSS attacks](https://en.wikipedia.org/wiki/Cross-site_scripting). Attributes starting with `hx-` and `data-hx`, -as well as inline `