Registry / security / sql-inject-reject

sql-inject-reject

JSON →
library0.1.0jsnpmunverified

Express/HTTP middleware that inspects request URLs and bodies for SQL injection patterns (SQL keywords, special characters) and blocks them with a 403 response. Version 0.1.0, last updated in 2017, no recent releases. Provides four security levels (silent, typical, elevated, paranoid) with hierarchical checks. Intended as one layer of defense; not a substitute for proper query validation or parameterized queries. Minimal configuration, but very limited maintenance and community adoption.

npm install sql-inject-reject
INSTALL
IMPORT
SIG · SQL-INJECT-REJECT
S
sql-inject-reject
securityjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const sqlInjectReject = require('sql-inject-reject');
Package is CommonJS only; no ESM or default export.

Shows how to set up the middleware with Express, configuring security level and custom keywords.

const express = require('express'); const sqlInjectReject = require('sql-inject-reject'); const app = express(); app.use(express.json()); app.use(sqlInjectReject({ level: 'elevated', keywords: ['UNION', 'SELECT'] })); app.post('/login', (req, res) => { res.send('OK'); }); app.listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
gotchaSecurity levels are hierarchical: paranoid includes elevated, typical, silent checks. Be aware that higher levels may cause false positives.
fix
Choose level carefully and test with your application traffic.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'sql-inject-reject'
Package not installed or npm install failed.
fix
Run 'npm install sql-inject-reject' in your project directory.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
expressoptionalDesigned as Express middleware, but can be used with any Node.js HTTP server via low-level integration.
Agent activity
15 hits · last 30 days
node
14
Resources
sql-inject-reject — npm install sql-inject-reject · libregistry