Skip to content

ninja-labs-tech/mongo-query-sanitize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Mongo query sanitize

clear mongo query from malicious operators (where) and unsafe regex expressions.

install

npm install mongo-query-sanitize

usage

const { sanitizeMongoQuery } = require('mongo-query-sanitize');

const maliciousQuery = {$where: "sleep(1000)"}; // or unsafe regex
sanitizeMongoQuery(maliciousQuery); // will throw error

Releases

No releases published

Packages

No packages published