citizenos / citizenos-api

Citizen OS API application - https://api.citizenos.com/
Other
31 stars 8 forks source link

[SECURITY] Lack of password confirmation #219

Closed EgidioRomano closed 2 years ago

EgidioRomano commented 2 years ago

What is the problem? When setting a new password or changing the email address from the "My account" page, the application does not require knowledge of the current user's password, or using another form of authentication. This could potentially be abused by an attacker to change passwords for another user, thus gaining the privileges associated with that user.

pwd-change

Possible solution. It is suggested to require the user to input their current password when they want to update critical information such as the password or email address.

ilmartyrk commented 2 years ago

Thank you for noticing this. We have discussed this issue. We went from "this is really simple mistake" to actually there was a reason why we initially didn't implement this solution. Anyway this really is a potential issue and we will add password requirement to this API endpoint. But as all users might not have password, users who have registered using (ID-card, Smart-ID or Mobile-ID), we probably have to discuss adding other confirmation methods.

ilmartyrk commented 2 years ago

FIX-ed with https://github.com/citizenos/citizenos-api/commit/27d6fb734f6b07fc7718002002fd16c8e8d0898c