id: aem-gql-servlet

info:
  name: AEM GQLServlet
  author: dhiyaneshDk,prettyboyaaditya
  severity: low
  description: AEM GQLServlet is exposed.
  reference:
    - https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/index.html?org/apache/jackrabbit/commons/query/GQL.html
  metadata:
    max-request: 29
    shodan-query: http.component:"Adobe Experience Manager"
  tags: aem,misconfig

http:
  - method: GET
    path:
      - "{{BaseURL}}{{paths}}"
    payloads:
      paths:
        - "/bin/wcm/search/gql.json?query=type:User%20limit:..1&pathPrefix=&p.ico"
        - "/bin/wcm/search/gql.servlet.json?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.1.json?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.4.2.1...json?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json;%0aa.css?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json;%0aa.html?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json;%0aa.js?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json;%0aa.png?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json;%0aa.ico?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.css?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.js?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.ico?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.png?query=type:base%20limit:..1&pathPrefix="
        - "/bin/wcm/search/gql.json/a.html?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.servlet.json?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.1.json?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.4.2.1...json?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json;%0aa.css?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json;%0aa.js?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json;%0aa.html?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json;%0aa.png?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json;%0aa.ico?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.css?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.ico?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.png?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.js?query=type:base%20limit:..1&pathPrefix="
        - "///bin///wcm///search///gql.json///a.html?query=type:base%20limit:..1&pathPrefix="

    stop-at-first-match: true

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

      - type: word
        words:
          - 'excerpt'
          - 'path'
          - 'hits'
        condition: and
# digest: 490a0046304402206193866bf0dd434662189198c5055f732162d34385c7367eeb2ae0e01bfa7c280220313b031c5d09c5ee1b46c97a0f6030379d2964a722e2c6765a265e3232d6cd87:922c64590222798bb761d5b6d8e72950