id: sonarqube-projects-disclosure

info:
  name: SonarQube - Information Disclosure
  author: DhiyaneshDk
  severity: medium
  description: |
    Information leakage vulnerability in an interface of SonarQube, you can download the source code through the tool.
  reference:
    - https://github.com/PeiQi0/PeiQi-WIKI-Book/blob/main/docs/wiki/webapp/SonarQube/SonarQube%20search_projects%20%E9%A1%B9%E7%9B%AE%E4%BF%A1%E6%81%AF%E6%B3%84%E9%9C%B2%E6%BC%8F%E6%B4%9E.md
    - https://github.com/deletescape/sloot
  classification:
    cpe: cpe:2.3:a:sonarsource:sonarqube:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: sonarsource
    product: sonarqube
    shodan-query: title:"Sonarqube"
    fofa-query: app="sonarQube-代码管理"
  tags: sonarqube,exposure,misconfig

http:
  - method: GET
    path:
      - "{{BaseURL}}/api/components/search_projects"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"visibility":"public"'
          - '{"organization'
        condition: and

      - type: word
        part: header
        words:
          - 'application/json'

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