• Douwe Maan's avatar
    Merge branch 'jej-note-search-uses-finder' into 'security' · 12db4cc0
    Douwe Maan authored
    Fix missing Note access checks in by moving Note#search to updated NoteFinder
    
    Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867
    
    ## Which fixes are in this MR?
    
     - Potentially untested  
    💣 - No test coverage  
    🚥 - Test coverage of some sort exists (a test failed when error raised)  
    🚦 - Test coverage of return value (a test failed when nil used)  
     - Permissions check tested
    
    ### Note lookup without access check
    
    - [x]  app/finders/notes_finder.rb:13 :download_code check
    - [x]  app/finders/notes_finder.rb:19 `SnippetsFinder`
    - [x]  app/models/note.rb:121 [`Issue#visible_to_user`]
    - [x]  lib/gitlab/project_search_results.rb:113
      - This is the only use of `app/models/note.rb:121` above, but importantly has no access checks at all. This means it leaks ...
    12db4cc0
note.rb 6.53 KB