CVE-2025-47776: MantisBT: Authentication bypass for some passwords due to PHP type juggling
Due to an incorrect use of loose (==) instead of strict (===) comparison in the [authentication code][1], PHP type juggling will cause interpretation of certain MD5 hashes as numbers, specifically those matching scientific notation.
[1]: https://github.com/mantisbt/mantisbt/blob/0fb502dd613991e892ed2224ac5ea3e40ba632bc/core/authenticationapi.php#L782
Impact On MantisBT instances configured to use the MD5 login method, user accounts having a password hash evaluating to zero (i.e. matching regex ^0+[Ee][0-9]+$) are vulnerable, allowing an attacker knowing the victim's username to login without knowledge of their actual password, using any other password having a hash evaluating to zero, for example comito5 (0e579603064547166083907005281618).
No password bruteforcing for individual users is needed, thus $gmaxfailedlogincount does not protect against the attack.
Patches Fixed in 2.27.2.
Workarounds Check the database for vulnerable accounts, and change those users' passwords, e.g. for MySQL: sql SELECT username, email FROM mantisusertable WHERE password REGEXP '^0+[Ee][0-9]+$'
Credits Thanks to Harry Sintonen / Reversec for discovering and reporting the issue.
Other sources
Mantis Bug Tracker (MantisBT) is an open source issue tracker. Due to incorrect use of loose (==) instead of strict (===) comparison in the authentication code in versions 2.27.1 and below.PHP type juggling will cause certain MD5 hashes matching scientific notation to be interpreted as numbers. Instances using the MD5 login method allow an attacker who knows the victim's username and has access to an account with a password hash that evaluates to zero to log in without knowing the victim's actual password, by using any other password with a hash that also evaluates to zero This issue is fixed in version 2.27.2.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-47776?
CVE-2025-47776 is considered a high-severity vulnerability due to potential authentication bypass.
How do I fix CVE-2025-47776?
To fix CVE-2025-47776, update to version 2.27.2 of the MantisBT software right away.
What is the cause of CVE-2025-47776?
CVE-2025-47776 is caused by improper use of loose comparison in the authentication code leading to PHP type juggling issues.
Which versions of MantisBT are affected by CVE-2025-47776?
Versions of MantisBT prior to 2.27.2 are affected by CVE-2025-47776.
Can CVE-2025-47776 lead to unauthorized access?
Yes, CVE-2025-47776 can lead to unauthorized access due to incorrect handling of MD5 hashes.