js-xss icon indicating copy to clipboard operation
js-xss copied to clipboard

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist

Results 66 js-xss issues
Sort by recently updated
recently updated
newest added

I want to use this package in my typescript project. How I will use this?

Is there a way to preserve the case of whitelisted attributes when using `filterXSS`? Given this code: ```js const svgText = "" const WHITELIST = { svg: ['id', 'xmlns', 'viewBox',...

Hi, Is there a way and if so how to see what attributes have been removed/escaped from the input string? I am thinking of a `removedElements` property or similar. I...

This particular HTML snippet would cause the alert to be executed. The library however, doesn't prevent this.

How to whitelist cookies from encoding using xss lib?

name: 'innerHTML', // xss白名单,可根据业务需求自己定制 value: `xss(_s(${directiveMeta.value}), { whiteList: { img: ['class', 'src', 'style', 'fileurl'], br: [], i: [], a: ['class', 'href', 'target'], span: ['class', 'style'], p: ['class'], font: ['style'], b:...

比如说增加a标签noopener, iframe标签增加sandbox等

`` processed result is ``

Wanted behavior: src of blob type won't be removed.

For example: `xss("This is a > test")` will result: `this is a > test` I wonder if there is a way to sanitise only Tags?