-
- Downloads
There was an error fetching the commit references. Please try again later.
Authorize access before serving project template
Previously, if a user was a guest member of a private project, they could access the merge request template as we were not checking permission-levels of the user. When a issue template is asked for, the user must have :read_issue for the project; or :read_merge_request when a merge request template is asked for. We also now rescue_from FileNotFoundError and handle as 404. This is because RepoTemplateFinder can raise a FileNotFoundError exception, which Rails previously handled as a 500. Handling these in a way that is consistent with ActiveRecord::RecordNotFound exceptions, within controllers that inherit from Projects::ApplicationController at least, and returning a 404. https://gitlab.com/gitlab-org/gitlab-ce/issues/54943
Showing
- app/controllers/projects/application_controller.rb 5 additions, 0 deletionsapp/controllers/projects/application_controller.rb
- app/controllers/projects/templates_controller.rb 15 additions, 2 deletionsapp/controllers/projects/templates_controller.rb
- changelogs/unreleased/security-prevent-detection-of-merge-request-template-name.yml 5 additions, 0 deletions...rity-prevent-detection-of-merge-request-template-name.yml
- config/routes/project.rb 4 additions, 1 deletionconfig/routes/project.rb
- spec/controllers/projects/templates_controller_spec.rb 81 additions, 29 deletionsspec/controllers/projects/templates_controller_spec.rb
- spec/routing/project_routing_spec.rb 20 additions, 0 deletionsspec/routing/project_routing_spec.rb
Please register or sign in to comment