thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Application & OT Security · Advanced

Type Juggling

Unexpected behavior from loosely typed comparisons, such as PHP's == operator, that can bypass authentication or checks.

Definition

Loose comparison may treat strings like '0e123' and '0e456' as equal numbers or compare a string to true. Mitigations: use strict comparison (=== in PHP and JavaScript), enforce input types and use constant-time functions for secrets.

Example

Two different password hashes beginning with 0e compare as equal under loose comparison.

Exam tip

Fix with strict typing and strict comparison operators.

Related terms