fix: Path traversal at SwaggerController (#6205)

This commit is contained in:
ooooooo_q
2023-01-13 03:14:21 +09:00
committed by GitHub
parent 9bbadc2388
commit 9e4a5d028c

View File

@@ -11,8 +11,8 @@ class SwaggerController < ApplicationController
def derived_path
params[:path] ||= 'index.html'
path = params[:path]
path << ".#{params[:format]}" unless path.ends_with?(params[:format].to_s)
path = Rack::Utils.clean_path_info(params[:path])
path << ".#{Rack::Utils.clean_path_info(params[:format])}" unless path.ends_with?(params[:format].to_s)
path
end
end