Skip to content

Commit f838c99

Browse files
committed
Fix nonce bug in wp_ninja_forms_unauthenticated_file_upload
If wordpress saves the nonce value in JavaScript, we could get an undefined method for nil.
1 parent a13e83a commit f838c99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/exploits/unix/webapp/wp_ninja_forms_unauthenticated_file_upload.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def fetch_ninja_form_nonce
109109
fail_with(Failure::UnexpectedReply, "Unable to access FORM_PATH: #{datastore['FORM_PATH']}")
110110
end
111111

112-
form_wpnonce = res.get_hidden_inputs.first['_wpnonce']
112+
form_wpnonce = res.get_hidden_inputs.first
113+
form_wpnonce = form_wpnonce['_wpnonce'] if form_wpnonce
113114

114115
nonce = res.body[/var nfFrontEnd = \{"ajaxNonce":"([a-zA-Z0-9]+)"/i, 1] || form_wpnonce
115116

0 commit comments

Comments
 (0)