Socket
Book a DemoInstallSign in
Socket

mongo-interceptor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-interceptor

MongoDB operator escaping, prevent NoSQL-injections

latest
Source
npmnpm
Version
0.3.1
Version published
Maintainers
1
Created
Source

mongo-interceptor

MongoDB (String) intrusion detector

Build Status

Installation

Install with npm install --save mongo-interceptor

Usage

Require the package like you always do: var mongoInterceptor = require('mongo-interceptor');

Methods

check()

You can check any Object, Array, or String for "harmful" mongoDB operators by calling mongoInterceptor.checkStr(possibleNOSQLInjectionString) and you will get an object in return, which contains the following information:

  • escaped: The escaped String
  • isIntrusion: The Boolean to tell if any mongoDB operators where detected and escaped
  • injections: The [String] if found mongoDB operators

See the interceptor-tests for further information.

setReplacer()

By default, mongo-interceptor is using the underscore (_) to escape/replace found mongoDB operators, but you can set any other replacement String you like - excluding $ itself.

Properties

VERSION

Returns the actual VERSION of the library in use.

Keywords

mongo

FAQs

Package last updated on 24 Mar 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.