express-sqlinjection-protect

1.0.1 • Public • Published

NPS sql-injection

This express module detects sql injection attacks and stops them by sending 403 as response. The module checks the query string, route params, and body for any sql injection related content.

var app = express();
var sqlinjection = require("express-sqlinjection-protect");
app.use(sqlinjection);

Installation

$ npm install sql-injection

Usage

code example:

var express = require("express");
var sqlinjection = require("express-sqlinjection-protect");

var app = express();

app.configure(function () {
  app.use(sqlinjection); // add sql-injection middleware here
});

app.get("/route1", function (req, res) {
  res.send(200, {});
});
app.get("/route2/:uid", function (req, res) {
  res.send(200, {});
});
app.post("/route3", function (req, res) {
  res.send(200, {});
});
app.listen(3000);

Package Sidebar

Install

npm i express-sqlinjection-protect

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

9.97 kB

Total Files

9

Last publish

Collaborators

  • cesarvaz