View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0034433 | mantisbt | security | public | 2024-05-05 04:30 | 2024-05-12 12:34 |
Reporter | rednaxela | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | sometimes |
Status | closed | Resolution | fixed | ||
OS | Debian GNU/Linux | OS Version | 12 (Bookworm) | ||
Product Version | 2.26.1 | ||||
Target Version | 2.26.2 | Fixed in Version | 2.26.2 | ||
Summary | 0034433: CVE-2024-34077: Account Takeover in Password Reset and Account Registration Feature | ||||
Description | The password reset and account registration feature is vulnerable to broken access control, it's possible to send HTTP request to /account_update.php with verify_user_id that belongs to another user account. However, this exploit only works when the following criterial is met:
| ||||
Steps To Reproduce |
=== Note: Since normal user won't be able to know which registration link has been clicked and which registration link belong to whom (don't have database access), brute force attack can be performed within the value of the verify_user_id parameter when sending request to the /account_update.php | ||||
Additional Information | https://github.com/mantisbt/mantisbt/security/advisories/GHSA-93x3-m7pw-ppqm I would like to be credited for the finding. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Many thanks for the detailed report, I'm looking into it. |
|
I had a look and can confirm the issue. In fact it's even worse than you describe, because it is actually possible to reset the password of any user that has a pending TOKEN_ACCOUNT_VERIFY, without the attacker even owning an account, using a brute-force approach calling account_update.php with increasing user IDs with a simple request like so:
For the record, even after this vulnerability is fixed, it will not be possible to be 100% bulletproof in a password reset/account creation scenario - if the attacker somehow obtains the confirmation hash, they will be able to reset the target user's password and there is nothing we can do about it (referring to point 2 of your steps to reproduce). |
|
I agree with you, if the attacker gains access to the confirmation_hash, then the account is highly likely to be compromised. What I'm concerned about in the 2nd step of step to reproduce is if the link got "accidentally opened" without changing the actual password, then the account will have the pending TOKEN_ACCOUNT_VERIFY. However, I believe it should be sufficient to include the confirmation_hash or a similar validation during password reset / registration, it can help to determine whether the current request is authorized to perform password changes for the given user_id. |
|
Yep, this is precisely how I was planning to address this issue. We use Github advisories to handle CVE requests and code review for security fixes. Please let me know your Github user id, so I can grant you access to a private fork for you to review and test the patch. |
|
Sure, my Github user id is 54769255 (https://github.com/redna-xela) |
|
Thanks, I actually meant username, not id, sorry ;-) I added you to the Github Advisory GHSA-93x3-m7pw-ppqm. You will also find a proposed patch there. Please review, feedback is welcome. |
|
Thank you, I'll look into this and get back to you as soon as possible. |
|
Thanks for waiting! I've reviewed the patches, and everything looks good. I've also confirmed that the previous vulnerability is no longer exploitable. |
|
Thanks for the feedback, that was quick :-) I'm now waiting for a CVE ID to be assigned. |
|
Thanks for asking. The advisory's wording, CVSS evaluation and selected CWE already looks good to me, but I would like to suggest the following if possible:
For the CVSS scoring, I believe the impact could be worse depending on who uses it and what kind of data is being stored, hence the C:H and I:H. Attack Complexity changed to High because successful attack cannot be accomplished at will, but rather need some perquisites to be fulfilled. I appreciate any feedback you may have. |
|
OK sounds good.
This is somewhat subjective, and as you say depends on external factors, in particular the access level of the account that gets hijacked.
I set it to low initially, because a brute-force attack can be launched at will and very easily, as explained in 0034433:0068886, even if the probability of success would be very low without some preparation work (e.g. social engineering to trick users so there are actual requests pending). Someone could just get lucky...
The idea was to have a quick and simple to implement option to reduce the risk, until a patch was available. I guess the point is kind of moot, as I would make the Advisory public together with the patch and 2.26.2 release, so anyone could either a) upgrade or b) apply the patch. |
|
Thanks for your input! I'm on board with you regarding the CVSS Scoring, I guess it would be better to use the previous score you've provided to avoid inflating the perceived risk. I also see your point about the workaround section, we can leave it as is. I think that's all, no further feedback from me based on what we've discussed :) |
|
Great, thanks for your collaboration. |
|
CVE-2024-34077 assigned |
|
MantisBT: master-2.26 92d11a01 2024-05-05 20:09 Details Diff |
Validate confirm hash when updating account This prevents an attacker from resetting another user's password if they have an incomplete account validation or password reset request pending. Fixes 0034433, CVE-2024-xxxxx |
Affected Issues 0034433 |
|
mod - account_update.php | Diff File | ||
mod - verify.php | Diff File | ||
MantisBT: master-2.26 b12b1f8b 2024-05-05 20:18 Details Diff |
Use g_reauthentication_expiry to set token timeout The timeout of the account verification token (TOKEN_ACCOUNT_VERIFY) is now set based on the $g_reauthentication_expiry config, instead of the TOKEN_EXPIRY_AUTHENTICATED constant. With default settings this does not change the system's behavior, but ensures there is a consistent timeout with other "secure" pages that require reauthentication and allows the admin to change the timeout, which was not possible before. The timeout is applied regardless of whether reauthentication is enabled or not. |
Affected Issues 0034433 |
|
mod - verify.php | Diff File |