Authentication Bypass Patterns

Detects common authentication bypass patterns including type juggling, SQL truncation, and logic flaws.

zakirkun 22a1fa8 2 files · 2.6 KB Updated

File contents

Authentication Bypass Patterns

Overview

Authentication bypasses exploit logical flaws:

  1. PHP type juggling: "0e1234..." == "0e5678..." (magic hash)
  2. SQL truncation: Long username overflows DB field to match existing user
  3. NULL password bypass: Some DBs accept NULL as matching any hash
  4. Mass assignment bypass: Posting isAdmin: true with registration data

Remediation

  • Use strict comparison (=== not == in PHP/JS)
  • Validate input length against database field limits
  • Use parameterized queries everywhere
  • Never trust user-submitted role or privilege fields

zakirkun/ice-tea/tree/main/skills/auth/auth-bypass-patterns commit 22a1fa8bb8

Frequently asked questions

npx skillmds@latest add zakirkun/authentication-bypass-patterns