PHPackages                             aldin-sxr/mongo-sanitize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. aldin-sxr/mongo-sanitize

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

aldin-sxr/mongo-sanitize
========================

A simple, no-dependency defense against MongoDB query selector injection attacks.

v1.0.0(6y ago)22.7k↓50%MITPHP

Since Oct 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Aldin-SXR/mongo-sanitize)[ Packagist](https://packagist.org/packages/aldin-sxr/mongo-sanitize)[ RSS](/packages/aldin-sxr-mongo-sanitize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

mongo-sanitize
==============

[](#mongo-sanitize)

[![Build Status](https://camo.githubusercontent.com/ef5195ade0b0970e363dcde9c112674eb790e28a00e7f5df4389c69fc3fae511/68747470733a2f2f7472617669732d63692e636f6d2f416c64696e2d5358522f6d6f6e676f2d73616e6974697a652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Aldin-SXR/mongo-sanitize)

A simple, no-dependency PHP library for defense against [MongoDB query selector injection attacks](https://blog.websecurify.com/2014/08/hacking-nodejs-and-mongodb.html). Inspired by the [homonymous NPM package](https://github.com/vkarpov15/mongo-sanitize) for NodeJS.

Installation and Usage
----------------------

[](#installation-and-usage)

The library is available via Composer.

`composer require aldin-sxr/mongo-sanitize`

After installing, include `vendor/autoload.php` in your project.

```
