Page cover
githubEdit

phpPHP Type Juggling

PHP uses "Loose Comparisons" (==) which automatically converts data types to match before comparing.

chevron-rightBoolean via JSONhashtag
  • Send raw boolean values true or false instead of a string.

  • Ensure Content-Type is application/json.

circle-info

Payloads

{"password": true}
{"admin": true}
{"verified": true}
chevron-rightArray Injectionhashtag

Convert a POST string parameter into an array to bypass logic checks

  • Functions like strcmp(), md5(), or sha1() expect strings.

  • If passed an array, they return NULL or throw an error. In loose comparisons (==), this often evaluates as True, bypassing authentication.

Last updated