Goodbye innerHTML, Hello setHTML: Stronger XSS Protection in Firefox 148 – Mozilla Hacks - the Web developer blog

Cross-site scripting (XSS) remains one of the most prevalent vulnerabilities on the web. The new standardized Sanitizer API provides a straightforward way for web developers to sanitize untrusted HTML before inserting it into the DOM. Firefox 148 is the first browser to ship this standardized security enhancing API, advancing a safer web for everyone. We expect other browsers to follow soon.

Mozilla Hacks – the Web developer blog
Goodbye innerHTML, Hello setHTML: Stronger XSS Protection in Firefox 148 – Mozilla Hacks - the Web developer blog

Cross-site scripting (XSS) remains one of the most prevalent vulnerabilities on the web. The new standardized Sanitizer API provides a straightforward way for web developers to sanitize untrusted HTML before inserting it into the DOM. Firefox 148 is the first browser to ship this standardized security enhancing API, advancing a safer web for everyone. We expect other browsers to follow soon.

Mozilla Hacks – the Web developer blog
Why the Sanitizer API is just <code>setHTML()</code>

Why the Sanitizer API is just <code>setHTML()</code>

Frederik Braun

[Перевод] setHTML(), Trusted Types и Sanitizer API

Ранняя версия Sanitizer API была реализована в Chrome, но позже была удалена . Поэтому не стоит ориентироваться на старые материалы — спецификация API со временем значительно изменилась. На данный момент Sanitizer API поддерживается в Firefox Nightly в соответствии с актуальной спецификацией. В Chrome Canary он также доступен, но только при включении специального флага. В Safari реализация пока не ведется, однако команда разработчиков Safari выразила поддержку этой инициативе. Trusted Types API уже реализован в Chrome/Edge, Samsung Internet, Safari и Firefox Nightly . В Chrome он поддерживается начиная с версии 83, а начиная с версии 144 полностью соответствует последней спецификации и реализации в других браузерах.

https://habr.com/ru/companies/timeweb/articles/965142/

#html #javascript #js #timeweb_статьи_перевод #sethtml #trusted_types #sanitizer #доверенные_типы #санитайзер #xss

setHTML(), Trusted Types и Sanitizer API

❯ Поддержка браузеров Ранняя версия Sanitizer API была реализована в Chrome, но позже была удалена . Поэтому не стоит ориентироваться на старые материалы — спецификация API со временем значительно...

Хабр
Ah, setHTML(), the latest way to write spaghetti code with an MDN blessing! 🍝😆 Discover the wonders of web APIs while desperately trying to avoid actually understanding them 🔄🤯. A riveting read for those who love endless HTML lists and CSS babble! 📜💤
https://developer.mozilla.org/en-US/docs/Web/API/Element/setHTML #setHTML #spaghettiCode #webAPIs #HTMLlists #CSSbabble #codingHumor #HackerNews #ngated
Element: setHTML() method - Web APIs | MDN

The setHTML() method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.

MDN Web Docs
Element: setHTML() method - Web APIs | MDN

The setHTML() method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.

MDN Web Docs