FusionCMS (FusionGen) Takeover account - Predictable Key and Password Generation in Password Recovery Feature in fusiongen/fusiongen

Valid

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.

We are processing your report and will contact the fusiongen team within 24 hours. 10 months ago
M - M
10 months ago

Researcher


@admin I can make POC if needed

M - M
10 months ago

Researcher


@admin I just contact the leader of source project on discord for report this .

M - M modified the report
10 months ago
M - M modified the report
10 months ago
M - M modified the report
10 months ago
We created a GitHub Issue asking the maintainers to create a SECURITY.md 10 months ago
We have contacted a member of the fusiongen team and are waiting to hear back 10 months ago
M - M
10 months ago

Researcher


@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.

We have sent a follow up to the fusiongen team. We will try again in 7 days. 10 months ago
M - M
10 months ago

Researcher


Alright

M - M
10 months ago

Researcher


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

M - M
10 months ago

Researcher


@admin https://github.com/FusionGen/FusionGEN/commit/4909c506a58f208a86f15676039c3bceeb02ee53

err0r1
10 months ago

Maintainer


Should be fixed now

Ben Harvie
10 months ago

Admin


@err0r1, if the vulnerability is fixed, please validate the report accordingly and submit the fix information so we can publish this report, thanks! :)

We have sent a second follow up to the fusiongen team. We will try again in 10 days. 10 months ago
We have sent a third and final follow up to the fusiongen team. This report is now considered stale. 9 months ago
M - M
9 months ago

Researcher


You can publicy the report?

err0r1 validated this vulnerability 9 months ago
M - M has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
err0r1 marked this as fixed in 1.0.7 with commit 4909c5 9 months ago
The fix bounty has been dropped
This vulnerability will not receive a CVE
err0r1 published this vulnerability 9 months ago
vicres1917
5 months ago

Hello My Friend, How are you? I have an issue about your cve-2023-27997. Can I ask about it here?

to join this conversation