SQL Injection Detection — ShipSafe
How ShipSafe detects SQL injection vulnerabilities in your code.
127 detection rulesLocal-only scanning
What is SQL Injection?
SQL injection occurs when untrusted user input is concatenated directly into SQL queries, allowing attackers to read, modify, or delete database data. It remains one of the most common and dangerous web vulnerabilities — consistently in the OWASP Top 10.
What ShipSafe Detects
- ✓Raw SQL queries with string concatenation or template literals containing user input
- ✓ORM bypass patterns where raw queries are used alongside an ORM
- ✓Parameterized query misuse (e.g., using string interpolation inside parameterized queries)
- ✓Dynamic table and column names derived from user input
- ✓Stored procedure calls with unsanitized parameters
- ✓Second-order SQL injection where stored data is later used in queries
- ✓NoSQL injection patterns in MongoDB queries
Example: Vulnerable Code
Vulnerable Express.js route with SQL injection
// Vulnerable: user input directly in SQL query
app.get("/users", async (req, res) => {
const { search } = req.query;
const result = await db.query(
`SELECT * FROM users WHERE name = '${search}'`
);
res.json(result.rows);
});ShipSafe Catches It
$ shipsafe scan
CRITICAL sql-injection/template-literal-in-query
src/routes/users.ts:4
User input from req.query is interpolated directly into SQL query.
Fix: Use parameterized queries — db.query("SELECT * FROM users WHERE name = $1", [search])Detect SQL Injection in Your Code
Install ShipSafe and scan your project in under 60 seconds.
npm install -g @shipsafe/cli