(no title)
exdeejay_ | 4 months ago
<p>Hello <scr<script>ipt>alert(1)</scr<script>ipt> World</p>
The program outputs: $ node .
<p>Hello <script>alert(1)</script> World</p>
{
sanitizedHTML: '<p>Hello <script>alert(1)</script> World</p>',
wasModified: true,
removedElements: [],
removedAttributes: []
}
Asking a chatbot to make a security function and then posting it for others to use without even reviewing it is not only disrespectful, but dangerous and grossly negligent. Please take this down.
codedokode|4 months ago
bilekas|4 months ago
foldr|4 months ago
> Write a JavaScript function for sanitizing arbitrary untrusted HTML input before setting a DOM element’s innerHTML attribute.
I won’t post it here in case someone tries to use it, but it wasn’t just doing regex munging.
unknown|4 months ago
[deleted]