-
- Downloads
Avoid #authenticate_user! in #route_not_found
This method, #route_not_found, is executed as the final fallback for unrecognized routes (as the name might imply.) We want to avoid `#authenticate_user!` when calling `#route_not_found`; `#authenticate_user!` can, depending on the request format, return a 401 instead of redirecting to a login page. This opens a subtle security exploit where anonymous users will receive a 401 response when attempting to access a private repo, while a recognized user will receive a 404, exposing the existence of the private, hidden repo.
Showing
- app/controllers/application_controller.rb 4 additions, 2 deletionsapp/controllers/application_controller.rb
- changelogs/unreleased/29986-remove-leaky-401-responses.yml 5 additions, 0 deletionschangelogs/unreleased/29986-remove-leaky-401-responses.yml
- spec/controllers/application_controller_spec.rb 0 additions, 6 deletionsspec/controllers/application_controller_spec.rb
- spec/controllers/projects/commits_controller_spec.rb 2 additions, 2 deletionsspec/controllers/projects/commits_controller_spec.rb
- spec/controllers/projects/error_tracking_controller_spec.rb 1 addition, 1 deletionspec/controllers/projects/error_tracking_controller_spec.rb
- spec/controllers/projects/issues_controller_spec.rb 2 additions, 2 deletionsspec/controllers/projects/issues_controller_spec.rb
- spec/controllers/projects/tags_controller_spec.rb 1 addition, 1 deletionspec/controllers/projects/tags_controller_spec.rb
- spec/controllers/projects_controller_spec.rb 1 addition, 1 deletionspec/controllers/projects_controller_spec.rb
- spec/features/projects/pipelines/pipelines_spec.rb 4 additions, 1 deletionspec/features/projects/pipelines/pipelines_spec.rb
- spec/features/projects/tags/user_views_tags_spec.rb 1 addition, 1 deletionspec/features/projects/tags/user_views_tags_spec.rb
- spec/support/controllers/sessionless_auth_controller_shared_examples.rb 18 additions, 4 deletions...ontrollers/sessionless_auth_controller_shared_examples.rb
- spec/support/shared_examples/controllers/todos_shared_examples.rb 1 addition, 1 deletion...port/shared_examples/controllers/todos_shared_examples.rb
Please register or sign in to comment