Skip to content

Commit 15df82d

Browse files
committed
Address brakeman security concern re: dispatching controller method via path
1 parent b9c3e11 commit 15df82d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/better_together/setup_wizard_steps_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class SetupWizardStepsController < WizardStepsController
66
skip_before_action :determine_wizard_outcome, only: %i[create_host_platform create_admin]
77

88
def redirect
9-
public_send params[:path]
9+
public_send permitted_path(params[:path])
1010
end
1111

1212
def platform_details
@@ -116,6 +116,10 @@ def create_admin # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
116116

117117
private
118118

119+
def permitted_path path
120+
path if %w[platform_details create_host_platform admin_creation create_admin].include?(path)
121+
end
122+
119123
def base_platform
120124
::BetterTogether::Platform.new(
121125
url: helpers.base_url,

0 commit comments

Comments
 (0)