# Authentication Bypass Patterns

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

- Skill: `zakirkun/authentication-bypass-patterns` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/authentication-bypass-patterns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/authentication-bypass-patterns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/authentication-bypass-patterns

---


# 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

