Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

perfect-express-sanitizer

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perfect-express-sanitizer - npm Package Compare versions

Comparing version 1.0.5 to 1.0.7

img/levels.png

106

data/mongo.js

@@ -28,3 +28,3 @@ module.exports = [

"keyword": "true, $where:",
"level": 5
"level": 1
},

@@ -53,3 +53,3 @@ {

"keyword": ".insert",
"level": 5
"level": 3
},

@@ -94,91 +94,91 @@ {

"keyword": "||",
"level": 5
"level": 1
},
{
"keyword": "||",
"level": 5
"level": 1
},
{
"keyword": "%00",
"level": 4
"level": 1
},
{
"keyword": "add",
"level": 4
"level": 3
},
{
"keyword": "drop(",
"level": 4
"level": 2
},
{
"keyword": "insertOne",
"level": 4
"level": 3
},
{
"keyword": "bulkWrite",
"level": 4
"level": 3
},
{
"keyword": "insertMany",
"level": 4
"level": 3
},
{
"keyword": "isCapped",
"level": 4
"level": 5
},
{
"keyword": "latencyStats",
"level": 4
"level": 5
},
{
"keyword": "mapReduce",
"level": 4
"level": 5
},
{
"keyword": "reIndex",
"level": 4
"level": 5
},
{
"keyword": "remove(",
"level": 4
"level": 3
},
{
"keyword": "renameCollection(",
"level": 4
"level": 2
},
{
"keyword": "replaceOne(",
"level": 4
"level": 5
},
{
"keyword": "stats(",
"level": 4
"level": 5
},
{
"keyword": "storageSize(",
"level": 4
"level": 5
},
{
"keyword": "totalIndexSize",
"level": 4
"level": 5
},
{
"keyword": "totalSize(",
"level": 4
"level": 5
},
{
"keyword": "unhideIndex",
"level": 4
"level": 5
},
{
"keyword": "update(",
"level": 4
"level": 3
},
{
"keyword": "updateOne(",
"level": 4
"level": 3
},
{
"keyword": "updateMany(",
"level": 4
"level": 3
},

@@ -199,35 +199,35 @@ {

"keyword": "createIndex",
"level": 4
"level": 2
},
{
"keyword": "createIndexes",
"level": 4
"level": 2
},
{
"keyword": "dataSize",
"level": 4
"level": 5
},
{
"keyword": "deleteOne",
"level": 4
"level": 3
},
{
"keyword": "deleteMany",
"level": 4
"level": 3
},
{
"keyword": "drop(",
"level": 4
"level": 2
},
{
"keyword": "dropIndex",
"level": 4
"level": 2
},
{
"keyword": "dropIndexes",
"level": 4
"level": 2
},
{
"keyword": "ensureIndex",
"level": 4
"level": 5
},

@@ -244,15 +244,15 @@ {

"keyword": "findAndModify",
"level": 4
"level": 3
},
{
"keyword": "findOneAndDelete",
"level": 4
"level": 3
},
{
"keyword": "findOneAndReplace",
"level": 4
"level": 3
},
{
"keyword": "findOneAndUpdate",
"level": 4
"level": 3
},

@@ -265,23 +265,23 @@ {

"keyword": "getShardDistribution",
"level": 4
"level": 5
},
{
"keyword": "getShardVersion",
"level": 4
"level": 5
},
{
"keyword": "hideIndex",
"level": 4
"level": 2
},
{
"keyword": "allowDiskUse",
"level": 4
"level": 5
},
{
"keyword": "forEach",
"level": 4
"level": 5
},
{
"keyword": "isExhausted",
"level": 4
"level": 5
},

@@ -298,3 +298,3 @@ {

"keyword": "aggregate",
"level": 3
"level": 5
},

@@ -311,27 +311,27 @@ {

"keyword": "$merge",
"level": 3
"level": 5
},
{
"keyword": "merge(",
"level": 3
"level": 5
},
{
"keyword": "lookup",
"level": 3
"level": 4
},
{
"keyword": "$lookup",
"level": 3
"level": 4
},
{
"keyword": "lookup(",
"level": 3
"level": 4
},
{
"keyword": "$project",
"level": 3
"level": 4
},
{
"keyword": "$expr",
"level": 3
"level": 4
},

@@ -348,4 +348,4 @@ {

"keyword": "findOne",
"level": 5
"level": 4
}
]

@@ -20,3 +20,3 @@ module.exports = [

flag: 'ig',
level: 1
level: 4
},

@@ -26,3 +26,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -32,3 +32,3 @@ {

flag: 'ig',
level: 1
level: 3
},

@@ -38,3 +38,3 @@ {

flag: 'ig',
level: 1
level: 3
},

@@ -44,3 +44,3 @@ {

flag: 'ig',
level: 1
level: 3
},

@@ -50,3 +50,3 @@ {

flag: 'ig',
level: 1
level: 2
},

@@ -56,3 +56,3 @@ {

flag: 'ig',
level: 1
level: 2
},

@@ -62,3 +62,3 @@ {

flag: 'ig',
level: 1
level: 2
},

@@ -68,3 +68,3 @@ {

flag: 'ig',
level: 1
level: 5
},

@@ -74,3 +74,3 @@ {

flag: 'ig',
level: 1
level: 5
},

@@ -80,3 +80,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -86,3 +86,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -92,3 +92,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -98,3 +98,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -104,3 +104,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -110,3 +110,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -116,3 +116,3 @@ {

flag: 'ig',
level: 1
level: 3
},

@@ -122,3 +122,3 @@ {

flag: 'ig',
level: 1
level: 5
},

@@ -128,3 +128,3 @@ {

flag: 'ig',
level: 1
level: 5
},

@@ -134,3 +134,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -140,3 +140,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -146,3 +146,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -152,3 +152,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -158,3 +158,3 @@ {

flag: 'ig',
level: 1
level: 4
},

@@ -169,17 +169,2 @@ {

flag: 'ig',
level: 1
},
// {
// regex: '`',
// flag: 'ig',
// level: 1
// },
// {
// regex: '``',
// flag: 'ig',
// level: 1
// },
{
regex: ',',
flag: 'ig',
level: 5

@@ -200,3 +185,3 @@ },

flag: 'ig',
level: 2
level: 5
},

@@ -206,14 +191,4 @@ {

flag: 'ig',
level: 2
level: 5
},
// {
// regex: '\\',
// flag: 'ig',
// level: 2
// },
// {
// regex: '\\/',
// flag: 'ig',
// level: 2
// },
{

@@ -224,7 +199,2 @@ regex: ';',

},
// {
// regex: `' or "`,
// flag: 'ig',
// level: 1
// },
{

@@ -310,7 +280,2 @@ regex: '-- or # ',

},
// {
// regex: '+',
// flag: 'ig',
// level: 5
// },
{

@@ -379,3 +344,3 @@ regex: '||',

flag: 'ig',
level: 5
level: 4
},

@@ -385,3 +350,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -396,3 +361,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -402,3 +367,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -408,3 +373,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -414,3 +379,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -420,3 +385,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -433,7 +398,2 @@ {

},
// {
// regex: 'Users) = 1',
// flag: 'ig',
// level: 5
// },
{

@@ -489,7 +449,2 @@ regex: 'VERSION()',

},
// {
// regex: '`',
// flag: 'ig',
// level: 5
// },
{

@@ -503,3 +458,3 @@ regex: '=',

flag: 'ig',
level: 5
level: 4
},

@@ -509,3 +464,3 @@ {

flag: 'ig',
level: 5
level: 4
},

@@ -562,7 +517,2 @@ {

},
// {
// regex: 'IF',
// flag: 'ig',
// level: 5
// },
{

@@ -588,7 +538,2 @@ regex: 'xcjl',

},
// {
// regex: '))',
// flag: 'ig',
// level: 5
// },
{

@@ -634,7 +579,2 @@ regex: 'delay',

},
// {
// regex: `'\/"`,
// flag: 'ig',
// level: 5
// },
{

@@ -753,5 +693,5 @@ regex: '&&SLEEP',

flag: 'ig',
level: 5
level: 3
},
]
{
"name": "perfect-express-sanitizer",
"version": "1.0.5",
"version": "1.0.7",
"description": "a complete package to control user input data to prevent Cross Site Scripting (XSS) ,Sql injection and no Sql injection attack",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -31,4 +31,3 @@ # perfect express sanitizer

noSql: true,
sql: true,
level: 5
sql: true
}));

@@ -46,10 +45,17 @@ ```

noSql: true,
sql: true,
noSqlLevel: 5,
sqlLevel: 1
sql: true
}, whiteList));
```
you can use more option
#### Levels
setting level from 1 to 5 for sql or nosql sanitizer.
higher level suggested and it will check more keywords.
<!-- ![alt text](https://github.com/hamedpa/perfect-express-sanitizer/blob/master/img/levels.png?raw=true) -->
<img src="./img/levels.png">
higher level contain lower level policies and check more keywords
why define different level?
sometimes you need to check only general keywords and all of your routes or some of them sending query or you don't need to set entire policies for them at this point you can set proper level for your application, higher level suggested.
```javascript

@@ -98,3 +104,3 @@

console.log(perfectExpressSanitizer.sanitizer("<script>alert('test')</script>", { xss: true, noSql: true, sql: true, level: 5 }));
console.log(perfectExpressSanitizer.sanitize("<script>alert('test')</script>", { xss: true, noSql: true, sql: true, level: 5 }));
```

@@ -101,0 +107,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc