
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
Set of shared security based functions to be used across all E-Bot7 applications.
The package is about a set of tools which help to deal with security and help to prevent XSS attacks.
The installation process is pretty common and it doesn't have any other peer dependencies.
npm install @ebot7/xss
import { sanitize } from "@ebot7/xss";
const dirtyHTML = "<h1>Hello world!</h1><p>We use <a href='https://quilljs.com' onmouseenter='alert(\"XSS\");'>Quill</a> as a wysiwyg editor</p>";
const cleanHTML = sanitize(dirtyHTML);
console.log(cleanHTML); //"<p>We use <a href='https://quilljs.com'>Quill</a> as a wysiwyg editor</p>"
It uses sanitize-html package under the hood with some preconfigured options. However, you could pass you own ones which will be deep merged with default options.
import { sanitize } from "@ebot7/xss";
const dirtyHTML = "<h1>Hello world!</h1><p>We use <a href='https://quilljs.com' onmouseenter='alert(\"XSS\");'>Quill</a> as a wysiwyg editor</p>";
const cleanHTML = sanitize(dirtyHTML, {allowedTags: ['h1']});
console.log(cleanHTML); //"<h1>Hello world!</h1><p>We use <a href='https://quilljs.com'>Quill</a> as a wysiwyg editor</p>"
Default options are deepe merged with given ones, that's why you could see an h1 tag in a result above.
To get default options you can import them like:
import { DEFAULT_SANITIZE_OPTIONS } from "@ebot7/xss";
And they are:
{
allowedTags: [
'a',
'b',
'br',
'div',
'em',
'i',
'img',
'li',
'ol',
'p',
'span',
'strong',
'u',
'ul',
],
allowedAttributes: {
a: ['href', 'name', 'target', 'rel'],
img: ['src', 'alt', 'width', 'height', 'align', 'style'],
},
}
FAQs
Set of shared security based functions to be used across all E-Bot7 applications.
We found that @ebot7/xss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.