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: 490a0046304402205f928d7cc3f30c52409036c220222d8544171c99f6fc60f06c5c72f5414b3d31022013f1afd0422012ab08293a67c557d73ff42fabe3916ccfe0767aa3ed96d99a9f:922c64590222798bb761d5b6d8e72950