Vulnerabilities in pkg:npm/jquery.terminal
PACKAGECVE-2021-43862 is a LOW (CVSS 3.7) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Jquery.terminal libraries in the npm ecosystem. The issue involves jquery.terminal self xss on user input. Remediation is available by upgrading affected packages to version 2.31.1.
pkg:npm/jquery.terminal
Vulnerability advisories affecting package pkg:npm/jquery.terminal. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-x9r5-jxvq-4387 | CVE-2021-43862 | LOW | jquery.terminal self XSS on user input |
| GHSA-2hwp-g4g7-mwwj | - | MODERATE | Reflected Cross-Site Scripting in jquery.terminal |
CVE-2021-43862 at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2021-43862
To remediate this vulnerability, upgrade all affected Jquery.terminal dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install jquery.terminal@2.31.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jquery.terminal
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-43862, inspect your project dependencies using npm:
npm ls jquery.terminal
Analyze the terminal output to locate any version of Jquery.terminal in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.31.1), your application is affected.
Note: The npm ls jquery.terminal command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Jquery.terminal, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-43862 Affected Jquery.terminal Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jquery.terminal
|
npm |
< 2.31.1
|
2.31.1
|
References
Frequently Asked Questions
What is CVE-2021-43862?
Which Jquery.terminal versions are affected?
What version fixes CVE-2021-43862?
Is jquery.terminal affected?
What is the CVSS score of CVE-2021-43862?
What CWE is associated with CVE-2021-43862?
How can I check npm dependencies for CVE-2021-43862?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x9r5-jxvq-4387",
"modified" : "2022-08-11T19:20:18Z",
"published" : "2022-01-06T22:48:56Z",
"aliases" : [ "CVE-2021-43862" ],
"summary" : "jquery.terminal self XSS on user input",
"details" : "### Impact\nThis is low impact and limited XSS, because code for XSS payload is always visible, but attacker can use other techniques to hide the code the victim sees.\n\nAlso if the application use execHash option and execute code from URL the attacker can use this URL to execute his code. The scope is limited because the javascript code inside html attribute used is added to span tag, so no automatic execution like with `onerror` on images is possible.\n\n### Patches\nFixed version 2.31.1\n\n### Workarounds\nThe user can use formatting that wrap whole user input and it's no op.\n\n```javascript\n$.terminal.new_formatter([/([\\s\\S]+)/g, '[[;;]$1]']);\n```\nThe fix will only work when user of the library is not using different formatters (e.g. to highlight code in different way).\n\n### References\nThe issue was reported here [jcubic/jquery.terminal#727](https://github.com/jcubic/jquery.terminal/issues/727)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [jcubic/jquery.terminal](https://github.com/jcubic/jquery.terminal)\n* Email us at [jcubic@onet.pl](mailto:jcubic@onet.pl)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jquery.terminal"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.31.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jcubic/jquery.terminal/security/advisories/GHSA-x9r5-jxvq-4387"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43862"
}, {
"type" : "WEB",
"url" : "https://github.com/jcubic/jquery.terminal/issues/727"
}, {
"type" : "WEB",
"url" : "https://github.com/jcubic/jquery.terminal/commit/77eb044d0896e990d48a9157f0bc6648f81a84b5"
}, {
"type" : "WEB",
"url" : "https://github.com/jcubic/jquery.terminal"
}, {
"type" : "WEB",
"url" : "https://github.com/jcubic/jquery.terminal/releases/tag/2.31.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-06T19:18:42Z",
"nvd_published_at" : "2021-12-30T15:15:00Z"
}
}