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

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

Related Security Categories