id: gitlab-uninitialized-password

info:
  name: Uninitialized GitLab instances
  author: GitLab Red Team
  severity: high
  description: |
    Prior to version 14, GitLab installations required a root password to be
    set via the web UI. If the administrator skipped this step, any visitor
    could set a password and control the instance.
  reference:
    - https://gitlab.com/gitlab-org/gitlab/-/issues/211328
    - https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5331
    - https://docs.gitlab.com/omnibus/installation/#set-up-the-initial-password
  metadata:
    max-request: 1
    shodan-query: http.title:"GitLab"
  tags: gitlab,misconfig,unauth,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/users/sign_in"

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'Change your password'
          - 'New password'
          - 'Confirm new password'
        condition: and

      - type: word
        part: header
        words:
          - 'gitlab_session'

      - type: status
        status:
          - 200
# digest: 4a0a0047304502210099e3db92b871a832b898cf43f23f6fde88e6f8b43f4d02f3445f397b30fcc20602206d0e806b4d54131e7ad3a97a3353da893b7cc4653ff33609ec7f01122b4247bd:922c64590222798bb761d5b6d8e72950