Skip to content

Here this express module detects SQL injection attacks and rejects the requests.

License

Notifications You must be signed in to change notification settings

Tanmoy-Barua/sql-sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Code Size

sql-sanitizer

Here the express module detects SQL injection attacks and stops them by sending 403 as a response. The module checks the query string, route parameters, and body for any SQL injection-related contents.

let app = express();
let sqlSanitizer = require('sql-sanitizer');
app.use(sqlSanitizer);

Installation

$ npm install sql-sanitizer

Usage

Example:

let express = require('express');
let app = express();
let sqlSanitizer = require('sql-sanitizer');
app.use(sqlSanitizer);

app.post('/route1', (req, res) => {
    res.status(200).send({});
});
app.get('/route2/:uid', (req, res) => {
    res.status(200).send({});
});
app.post('/route3', (req, res) => {
   res.status(200).send({});
});

app.listen(4000);

About

Here this express module detects SQL injection attacks and rejects the requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages