So turning trees into charcoal scales up to a certain point, but not to the point that it "would even remotely make a difference for climate change", as OP said.
It's also risky to have the primary password credential transmitted instead of temporary tokens.
https://www.sjoerdlangkemper.nl/2024/05/29/string-comparison...
https://www.sjoerdlangkemper.nl/2024/06/26/htmx-content-secu...
<div hx-disable>
<%= raw(user_content) %>
</div>
So, I get that `raw` prevents htmx from being used. I get that `<script>` still works.But I find it scary that if `user_content` is `</div><div>...` that is actually injected, as raw HTML. I would expect that the `<%= raw(user_content) %> only has access to contents of the div it is in itself, and nothing more. But instead I understand that the HTML is injected as text (?) and then re-parsed (?).
In Angular, for example, the template is parsed into a DOM tree, and then template variables are placed in the correct place. This makes injection really hard. In the above example, it would be impossible to break out of the div.
Other template engines just do a string search/replace, and this makes injection easy. Then it's indeed possible to break out of the div just by injecting </div>.
The example you quoted comes directly from the HTMX docs. They don't specify which template system is used, and I don't immediately recognize the syntax to limit it to a specific template system.
Apparently there are some proposals to make official UUID variants with this sort of composition too, which some threads in this discussion go into more detail on.
"Planting 1.2 Trillion Trees Could Cancel Out a Decade of CO2 Emissions, Scientists Find"
I'll expand on what I said before: Make front lawns illegal throughout the US. Require two or more trees to be planted (use some kind of a formula for the exact amount). We can probably get to half a billion trees just with this approach. However, this has the added effect of eliminating emissions from gas powered mowers, blowers, trimmers, etc. We would consumer less water to grow lawns, capture CO2 effectively to grow trees and reduce emissions from the aforementioned demonic devices in the process. I call that a good start until we figure out other methods that might operate at scale without destroying the planet in the process. Actually, there are at least a couple more things at scale we could do that would be net positive on many fronts. More on that later.
https://e360.yale.edu/digest/planting-1-2-trillion-trees-cou...
See also this https://news.ycombinator.com/item?id=13016132
It also looks like you do normal String equals to compare secrets, which could be vulnerable to a timing attack.
Are you sure you are qualified to implement crypto?