UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks

13 lines (12 loc) 583 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.detectSQLInjection = detectSQLInjection; const shouldReturnEarly_1 = require("./shouldReturnEarly"); // eslint-disable-next-line camelcase const zen_internals_1 = require("../../internals/zen_internals"); function detectSQLInjection(query, userInput, dialect) { if ((0, shouldReturnEarly_1.shouldReturnEarly)(query, userInput)) { return false; } return (0, zen_internals_1.wasm_detect_sql_injection)(query.toLowerCase(), userInput.toLowerCase(), dialect.getWASMDialectInt()); }