FusionCMS (FusionGen) Takeover account - Predictable Key and Password Generation in Password Recovery Feature in fusiongen/fusiongen
Reported on
Jan 24th 2023
Description
It was discovered that the password recovery feature on the website is vulnerable to predictable key and password generation. An attacker is able to predict the key used in the password recovery process and the generated password itself by using a specific PHP command and the user's email and username.
Details
The password recovery feature on the website allows users to request a password reset by providing their email and username. The system then sends a key to the user's email, which when clicked, allows the user to reset their password. The key is generated using a sha1 hash of the user's email and username, concatenated with the current timestamp. An attacker can predict this key by running a specific PHP command with the user's email and username. Once the key is obtained, the attacker can then predict the generated password by running another PHP command.
Proof of Concept
Note: The PHP commands above should be executed simultaneously with the post-data request (burpsuite) on the targeted website.
Execute the following PHP command on the command line to generate the key for the recovery email:
Payload: php -r '$username = "TEST"; $email = "test@example.com"; $key = sha1($username.":".$email.":".time()); echo $key;'
Occurence: $key = sha1($username . ":" . $email . ":" . time());
Once the key has been obtained run the GET request "/password_recovery/requestPassword/0xxxx...." simultaneously with the following PHP command to predict the generated password:
Payload: php -r 'function generatePassword() { return substr(sha1(time()), 0, 10); } echo generatePassword();'
Occurence: return substr(sha1(time()), 0, 10);
With the key and predicted password, an attacker can now use them to reset the password for the targeted account (admin) without the need for the legitimate user's input.
Impact
An attacker can gain access to a user's account by predicting the key and generated password. This can potentially lead to sensitive information being compromised. The key generation process should be made more secure by using a cryptographically secure algorithm and adding a unique and unpredictable salt. The password generation process should also be made more secure by using a cryptographically secure random number generator.
@admin I just contact the leader of source project on discord for report this .
SECURITY.md
10 months ago
@admin They fusiongen leader gave his email (admin@fusiongen.net) with the https://github.com/FusionGen/FusionGEN/blob/main/.github/SECURITY.md
They waiting your contact.
Can you discover the issue, the leader of fusiongen just fixed the issues based of informations he got from me in conversation in discord @admin
@admin https://github.com/FusionGen/FusionGEN/commit/4909c506a58f208a86f15676039c3bceeb02ee53
@err0r1, if the vulnerability is fixed, please validate the report accordingly and submit the fix information so we can publish this report, thanks! :)
Hello My Friend, How are you? I have an issue about your cve-2023-27997. Can I ask about it here?