You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tag open < and > are not properly encoded inside attribute values.
They should become < and > - they makes the lib dangerous in projects dealing with user input/output.
The text was updated successfully, but these errors were encountered:
iongion
changed the title
Entities in parameters are not properly encoded
Math inequality symbols in attributes are not properly encoded
Feb 4, 2018
For when running inside the web browser, a safe way to encode attribute values would be something like this:
function htmlEncode(value) {
const div = document.createElement('div');
div.textContent = value;
return div.innerHTML;
}
Unfortunately, node env does not offer such a built-in, so you cannot rely on it, you could nevertheless, reference https://www.npmjs.com/package/js-htmlencode in your dependencies and use those functions to perform encoding. Encoding is not trivial task, use a library!
This person already tried disabling the encoding part of this project:
The tag open
<
and>
are not properly encoded inside attribute values.They should become
<
and>
- they makes the lib dangerous in projects dealing with user input/output.The text was updated successfully, but these errors were encountered: