id: apachespark-ui-exposed

info:
  name: Apache Spark Application UI  - Exposed
  author: ritikchaddha
  severity: medium
  description: |
    Detects exposed PySparkShell Application UI by Apache Spark on port 4040. The UI should not be exposed to the internet as it may leak sensitive job and cluster information.
  reference:
    - https://spark.apache.org/docs/latest/web-ui.html
  metadata:
    verified: true
    max-request: 1
    vendor: apache
    product: spark
    shodan-query: title:"spark master at"
    fofa-query: title="spark master at"
  tags: spark,pyspark,ui,exposed,panel,apache

http:
  - method: GET
    path:
      - "{{BaseURL}}/jobs/"
      - "{{BaseURL}}:4040/jobs/"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        words:
          - "Spark Jobs"
          - "application UI"
        condition: and

      - type: status
        status:
          - 200
# digest: 4b0a00483046022100e49bb5d0e2ac3033ea6c834c51ae3b7042e762e316f6aa7c6bf027cc139226d9022100f747afec9ad1e02733caa479f4e240a12f1a8ea257060770cbe43f15fe61ddbb:922c64590222798bb761d5b6d8e72950