CVE-2021-43862 is a medium-severity (CVSS 5.4) CWE-80 vulnerability in jquery.terminal. 1 public exploit reference exists, so weaponization risk is real. A fix is available for jquery.terminal — see the affected versions and patch details below.
jquery.terminal self XSS on user input
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-43862 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
jquery.terminalnpmDescription
Impact
This 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.
Also 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.
Patches
Fixed version 2.31.1
Workarounds
The user can use formatting that wrap whole user input and it's no op.
$.terminal.new_formatter([/([\s\S]+)/g, '[[;;]$1]']);
The fix will only work when user of the library is not using different formatters (e.g. to highlight code in different way).
References
The issue was reported here jcubic/jquery.terminal#727
For more information
If you have any questions or comments about this advisory:
- Open an issue in jcubic/jquery.terminal
- Email us at [email protected]
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | jquery.terminal | all versions | 2.31.1npm install jquery.terminal@2.31.1 |
Affected Products
jquery.terminaljquery.terminal_projectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for jquery.terminal, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update jquery.terminal to 2.31.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-43862 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2021-43862 in your dependencies?
Find it across npm, including transitive dependencies.