{"_id":"sql-inject-reject","_rev":"1-1b30a1a8b18e263faa549894d9272f97","name":"sql-inject-reject","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"sql-inject-reject","version":"0.1.0","description":"HTTP server middleware for detecting and rejecting SQL injection attempts","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Redeux/sql-inject-reject.git"},"keywords":["SQL","SQL Injection","Middleware","HTTP","Server","Express","Inject","Security"],"author":{"name":"Phil Sautter"},"license":"MIT","bugs":{"url":"https://github.com/Redeux/sql-inject-reject/issues"},"homepage":"https://github.com/Redeux/sql-inject-reject#readme","dependencies":{"raw-body":"2.3.3","xregexp":"4.2.0"},"devDependencies":{"chai":"^4.1.2","chai-as-promised":"^7.1.1","eslint":"^4.19.1","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.12.0","express":"^4.16.3","mocha":"^5.2.0","supertest":"^3.1.0"},"gitHead":"c965fc5586e36a1809013f463e00cf4da9f8a950","_id":"sql-inject-reject@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"redeux","email":"atredeux@gmail.com"},"dist":{"integrity":"sha512-cFpEHJQEBjxXzfVH1ifpfPfe2fnOsqt7TyhusQ5pK959IsKNRJTFYQsxARFuHkt9bPObzhNbXGPCz+/ics5i3g==","shasum":"584910aea81d4ee5d779cd2130b2ed1b26ae9f8c","tarball":"https://registry.npmjs.org/sql-inject-reject/-/sql-inject-reject-0.1.0.tgz","fileCount":13,"unpackedSize":78527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKtp1CRA9TVsSAnZWagAAG60P/izMbRjsUdvH13XEL5og\nwIEHmnxKt/rs4hwRaLVxtBAF/YFgawHe6eZRYhTZgeejsSbqPlB+d+vP+PPB\nzZVlrlpUyIlCJNdN0VBV4kU8DmhNKewWSzJOhnlolPH7+G8eC6jeOWLviA0D\nzUXyTPKofAfqnm5BBlOYTsMJi9JYyd9byrXsk+epaAutQcXw/itikdBfPvf9\njNgqSZnPbU/tU9o7AVFA+GKbIwZQI465RmclsIjL20l6cGXkGpQ3rjJMnvHp\ndTsJoHf9r1XbuDOC1oCzkGwOPKS7/N7FIfB+z8UJLZQKc8OT5nHNJ//PMghs\n5ALBtso8EA5RtiNVYfJExn4ReGR9YKcWI2EXzdNVdW4Oan1JxXfSFcKj4nKD\nkp8bVcLYqyiiAemkPfXmwBz2IwMp2AxjnPENsC9J4aqZvarL+R2fsoxkKY7D\nlXRF1Hn6mrfd9o34vObAVmNxgDsj9hUdBMS7dZSAwmBOOdV/VAh44gzz8Lhj\nPMO0oGT304+O5mo+5WPg2ZXX/W39zwo6GIfXoQ+kO75gwVFW79+NJYjtVP0Y\nmjXcihD/aYA3lId78qKD3+eU9pEteEIXzA93aFo+HTnBYfPEdUoECHrUmeXF\nXxeefbB/fLPQUCSOVteIEUpRg+1aGsu6ed45lZejop4PrRceFesQe4kdSpzH\n2j46\r\n=PyOe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICG1E3Dly9N0ZIOuJQpNOCenDcY/Gv0HiU1kp9phdNPNAiEA74063XIdfB6oIRBYBm89wsPFpWFum9GmR4/fgDeFk/4="}]},"maintainers":[{"name":"redeux","email":"atredeux@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sql-inject-reject_0.1.0_1529535091915_0.6929348982511192"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-20T22:51:31.915Z","0.1.0":"2018-06-20T22:51:31.980Z","modified":"2022-05-18T12:28:43.838Z"},"maintainers":[{"name":"redeux","email":"atredeux@gmail.com"}],"description":"HTTP server middleware for detecting and rejecting SQL injection attempts","homepage":"https://github.com/Redeux/sql-inject-reject#readme","keywords":["SQL","SQL Injection","Middleware","HTTP","Server","Express","Inject","Security"],"repository":{"type":"git","url":"git+https://github.com/Redeux/sql-inject-reject.git"},"author":{"name":"Phil Sautter"},"bugs":{"url":"https://github.com/Redeux/sql-inject-reject/issues"},"license":"MIT","readme":"# SQL-Inject-Reject [![Build Status](https://travis-ci.org/Redeux/sql-inject-reject.svg?branch=master)](https://travis-ci.org/Redeux/sql-inject-reject) [![Coverage Status](https://coveralls.io/repos/github/Redeux/sql-inject-reject/badge.svg?branch=master)](https://coveralls.io/github/Redeux/sql-inject-reject?branch=master) [![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://github.com/Redeux/sql-inject-reject/blob/master/LICENSE) \n\n  Detect and reject SQL injection attempts before processing them.\n\n## About\n\n  Analyzes HTTP a request's URL and body as they're received and if a SQL statement is detected responds with 403 Forbidden.  Intended to be part of a layered security approach.\n\n## Getting Started\n  \n  Install sql-inject-reject as an npm module and save it to your package.json file as a dependency:\n\n  ```\nnpm install sql-inject-reject\n  ```\n\n  Once it's installed you can reference it by calling ```require('sql-inject-reject');```\n\n## Usage\n\n  The middleware allows for configuration of the security level and SQL keywords to reject.\n\n  The security levels are `paranoid` `elevated` `typical` and `silent`.  The security level is set to `typical` if no level is specified. Security levels may be specified on load:\n\n  ```js\napp.use(sqlInjectReject({ level: 'elevated' }))\n  ```\n\n  By default any security level `typical` or above looks for the `OR` SQL keyword.  \n  \n  Additional keywords can be specified with or without specifying a security level.  Keywords are validated regardless of their case and their hex equivalents.\n  \n  Keywords must be specified as an array:\n\n  ```js\napp.use(sqlInjectReject({ keywords: ['UNION','SELECT'] }))\n  ```\n  You may pass the middleware to your http server with `app.use()`:\n  ```js\nconst sqlInjectReject = require('sql-inject-reject');\nconst express = require('express');\n\nconst app = express();\n\napp.use(sqlInjectReject());\n  ```\n\nOr you may pass the middleware to a specific route or routes:\n  ```js\nconst sqlInjectReject = require('sql-inject-reject');\nconst express = require('express');\n\nconst app = express();\n\napp.post('/login', sqlInjectReject(), function(req, res) {\n    // some code here\n});\n  ```\n\n## Security Levels\n\nBy default security levels are hierarchical, which means higher security levels perform the validations of the security levels below them as well as their own.  The security level hierarchy is as follows: `paranoid` > `elevated` > `typical` > `silent`\n\n* Paranoid: Checks for any of `'` `--` `#` and their hex equivalents. It is likely to produce a lot of false positives.\n* Elevated: Checks for `=` followed by any `'` `--` `;` and their hex equivalents.\n* Typical: Checks for `'OR` is any case and its hex equivalents.\n* Silent: Performs no SQL checks but can still be used with specific keywords.\n\n## Notes\n\n  This package is not intended to be a substitute for SQL query validation.\n\n## License\n  \n  MIT","readmeFilename":"README.md"}