Skip to content
vetkitChecksChangelogDocumentation

vetkit.php.auth.loose-hash-comparison

A hash, HMAC or password digest is compared with loose == / !=. PHP type juggling treats '0e…' digests as equal numbers, allowing authentication bypass.

Last updated:

Suite: Security

php

A hash, HMAC or password digest is compared with loose == / !=. PHP type juggling treats '0e…' digests as equal numbers, allowing authentication bypass.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Compare secrets with hash_equals($known, $user) and passwords with password_verify().

References

Source: packages/engine/rules/sast/php.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.