Insecure Authentication Detection — ShipSafe

How ShipSafe detects authentication and session management vulnerabilities.

98 detection rulesLocal-only scanning

What is Insecure Authentication?

Insecure authentication encompasses vulnerabilities in how applications verify user identity and manage sessions. Weak authentication allows attackers to compromise passwords, keys, or session tokens, or exploit implementation flaws to assume other users' identities.

What ShipSafe Detects

Example: Vulnerable Code

Missing authentication and weak password hashing

// Vulnerable: no auth middleware on admin route
app.delete("/api/users/:id", async (req, res) => {
  await db.query("DELETE FROM users WHERE id = $1", [req.params.id]);
  res.json({ deleted: true });
});

// Vulnerable: weak password hashing
const crypto = require("crypto");
const hash = crypto.createHash("md5").update(password).digest("hex");

ShipSafe Catches It

$ shipsafe scan

  HIGH  auth/missing-auth-middleware
  src/routes/admin.ts:1
  DELETE endpoint /api/users/:id has no authentication middleware.
  Fix: Add authentication middleware — app.delete("/api/users/:id", requireAuth, async (req, res) => { ... })

  HIGH  auth/weak-password-hash
  src/auth.ts:3
  MD5 used for password hashing. MD5 is cryptographically broken.
  Fix: Use bcrypt or argon2 — await bcrypt.hash(password, 12)

Detect Insecure Authentication in Your Code

Install ShipSafe and scan your project in under 60 seconds.

npm install -g @shipsafe/cli

Related Security Categories