Comparing version 0.2.13 to 0.2.14
{ | ||
"name": "xss", | ||
"main": "./lib/index.js", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist", | ||
@@ -25,8 +25,13 @@ "author": "leizongmin <leizongmin@gmail.com> (http://ucdok.com)", | ||
"devDependencies": { | ||
"blanket": "^1.2.1", | ||
"browserify": "^12.0.1", | ||
"coveralls": "^2.11.9", | ||
"debug": "^2.2.0", | ||
"istanbul": "^0.4.3", | ||
"mocha": "^2.3.4", | ||
"uglify-js": "^2.6.1" | ||
}, | ||
"files": [ | ||
"lib", | ||
"bin/xss" | ||
], | ||
"bin": { | ||
@@ -36,18 +41,7 @@ "xss": "./bin/xss" | ||
"scripts": { | ||
"coverage": "./node_modules/mocha/bin/mocha --require blanket -R html-cov > coverage.html -t 5000 && open coverage.html", | ||
"test": "export DEBUG=xss:* && ./node_modules/mocha/bin/mocha -t 5000", | ||
"test": "export DEBUG=xss:* && mocha -t 5000", | ||
"test-cov": "export DEBUG=xss:* && istanbul cover _mocha --report lcovonly -- -t 5000 -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", | ||
"build": "./bin/build", | ||
"prepublish": "npm run test && npm run build" | ||
}, | ||
"config": { | ||
"blanket": { | ||
"pattern": [ | ||
"" | ||
], | ||
"data-cover-never": [ | ||
"node_modules", | ||
"test" | ||
] | ||
} | ||
}, | ||
"licenses": [ | ||
@@ -54,0 +48,0 @@ { |
@@ -24,2 +24,3 @@ [![NPM version][npm-image]][npm-url] | ||
Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist. | ||
@@ -41,3 +42,2 @@ ====== | ||
--------------- | ||
@@ -67,5 +67,6 @@ | ||
## Unit Test | ||
## They are using xss module | ||
Run `npm test` command in the source directary. | ||
+ **nodeclub** - A Node.js bbs using MongoDB - https://github.com/cnodejs/nodeclub | ||
+ **cnpmjs.org** - Private npm registry and web for Enterprise - https://github.com/cnpm/cnpmjs.org | ||
@@ -291,2 +292,21 @@ | ||
### Customize CSS filter | ||
If you allow the attribute `style`, the value will be processed by [cssfilter](https://github.com/leizongmin/js-css-filter) module. The cssfilter module includes a default css whitelist. You can specify the options for cssfilter module like this: | ||
```javascript | ||
myxss = new xss.FilterXSS({ | ||
css: { | ||
whiteList: { | ||
position: /^fixed|relative$/, | ||
top: true, | ||
left: true, | ||
} | ||
} | ||
}); | ||
html = myxss.process('<script>alert("xss");</script>'); | ||
``` | ||
For more help, please see https://github.com/leizongmin/js-css-filter | ||
### Quick Start | ||
@@ -379,3 +399,3 @@ | ||
``` | ||
```html | ||
<div a="1" b="2" data-a="3" data-b="4">hello</div> | ||
@@ -404,3 +424,3 @@ convert to: | ||
``` | ||
```html | ||
<x><x-1>he<x-2 checked></x-2>wwww</x-1><a> | ||
@@ -433,3 +453,3 @@ convert to: | ||
``` | ||
```html | ||
image list: | ||
@@ -455,3 +475,3 @@ img1, img2, img3, img4 | ||
``` | ||
```html | ||
text: helloend | ||
@@ -458,0 +478,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
500
0
40127
6
9
860
1