requests_profiles_controller.rb
code Moderate
File Access
Discovered 7 months ago
Source: static code analysis
Category: File Access
Confidence level: Weak

Problem

Parameter value used in file name

Location

app/controllers/admin/requests_profiles_controller.rb:19

send_file(Gitlab::RequestProfiler.find(Rack::Utils.clean_path_info(params[:name])).file_path, :type => ("#{Gitlab::RequestProfiler.find(Rack::Utils.clean_path_info(params[:name])).content_type}; charset=utf-8"), :disposition => "inline")

Category description: When user-supplied input can contain ".." or similar characters that are passed through to file access APIs, causing access to files outside of an intended subdirectory.

Solution: fix the issue in app/controllers/admin/requests_profiles_controller.rb or mark it as false positive.

help_controller.rb
code Moderate
File Access
Discovered 7 months ago
Source: static code analysis
Category: File Access
Confidence level: Weak

Problem

Parameter value used in file name

Location

app/controllers/help_controller.rb:43

send_file(File.join(Rails.root, "doc", "#{Rack::Utils.clean_path_info(path_params[:path])}.#{params[:format]}"), :disposition => "inline")

Category description: When user-supplied input can contain ".." or similar characters that are passed through to file access APIs, causing access to files outside of an intended subdirectory.

Solution: fix the issue in app/controllers/help_controller.rb or mark it as false positive.