id: craftcms-log-disclosure

info:
  name: Craft CMS - Log File Disclosure
  author: pussycat0x
  severity: medium
  description: |
    Detected exposed Craft CMS log files due to misconfiguration, allowing unauthenticated access to sensitive information including error messages, stack traces, database queries, and potentially credentials or session data.
  reference:
    - https://craftcms.com/docs/5.x/system/logging.html
    - https://craftcms.com/knowledge-base/locating-error-logs-and-database-backups
    - https://github.com/craftcms/cms/issues/3619
  metadata:
    verified: true
    max-request: 1
    shodan-query: http.component:"Craft CMS"
    fofa-query: app="Craft-CMS"
  tags: craftcms,cms,exposure,logs,misconfig

http:
  - method: GET
    path:
      - "{{BaseURL}}/storage/logs/web.log"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "craft_cms"
          - "UrlManager"
          - "schemaVersion"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a00463044022079fc26dc478b04d2127bc753bb718a9f3f66f6fbbfb836c07614a72c88bf0ede0220058779dc86856d340e774474a5bbfe1aa44bde614af17e9ebd35b95e1559f71e:922c64590222798bb761d5b6d8e72950