id: springboot-x-application-context

info:
  name: Spring Boot `X-Application-Context` Header Exposure
  author: DhiyaneshDK
  severity: low
  description: |
    Detected the presence of the X-Application-Context header in HTTP responses, which can expose sensitive application context information.
  reference:
    - https://github.com/spring-projects/spring-boot/issues/1308
  metadata:
    verified: true
    max-request: 1
    shodan-query: "X-Application-Context"
  tags: springboot,misconfig,exposure

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - '^X-Application-Context:\s*\S.+$'

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: header
        group: 1
        regex:
          - '^X-Application-Context:\s*\S.+$'
# digest: 4a0a00473045022100b62d9602ee957dece5c397ab34c6843f6bcee538fb14b1f8c22d07a5d12fbdc9022050341014b3a7a70b3b0945fb4c00d73c7da56ebc35e8d8e4353d95ce21c404b9:922c64590222798bb761d5b6d8e72950