id: exposed-gitmodules

info:
  name: .gitmodules File Exposed
  author: pussycat0x
  severity: high
  description: |
    The .gitmodules file was exposed on the web server as part of an accessible .git directory.This exposure indicated a misconfiguration that could have allowed attackers to explore the .git directory further and potentially reconstruct or download the full source code repository.
  reference:
    - https://www.acunetix.com/vulnerabilities/web/git-repository-found/
    - https://pentester.land/tutorials/2018/10/25/source-code-disclosure-via-exposed-git-folder.html
  tags: exposure,git,source-disclosure,misconfig

http:
  - method: GET
    path:
      - "{{BaseURL}}/.gitmodules"

    matchers:
      - type: dsl
        dsl:
          - "status_code == 200"
          - "contains_all(body, '[submodule', 'path =', 'url =')"
        condition: and
# digest: 4a0a0047304502206dc17285ef93019f6030efebe0664e67e2806deee362e2ed38a190bfd2a66427022100d04a95decbe760ff9c00b6a525e536cfd6a1d93d28c9d780eef083e9b5be7cb8:922c64590222798bb761d5b6d8e72950