Sjoerd
Joined 10 years ago
Joined 10 years ago
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.
https://www.sjoerdlangkemper.nl/2024/05/29/string-comparison...
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.
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?
https://www.sjoerdlangkemper.nl/2017/07/05/prevent-session-h...