Skip to content

Commit dd28ce7

Browse files
committed
Prevent DOS attack via Symbol injection in AdminController
1 parent ccce5c0 commit dd28ce7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/controllers/admin_controller.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def sections_teams
4747
end
4848

4949
def section_teams
50-
@teams = Team.with_completed_section(params[:section].to_sym)
50+
@teams = Team.with_completed_section(parse_section_name(params[:section]))
5151
end
52-
end
52+
53+
def parse_section_name(section_name)
54+
name = Team::SECTIONS.select { |section| section == section_name }.first
55+
return name.to_sym unless name.nil?
56+
end
57+
end

0 commit comments

Comments
 (0)