CVE-2019-14862: XSS in knockout

knockout Updated 02 Oct 2025

Summary

01/04/2020
Yes i
Moderate
6.1

CVE-2019-14862: XSS in knockout. Affects knockout versions < 3.5.0. Fixed in 3.5.0. How to fix ↓

Also tracked for

The same CVE-2019-14862 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Knockout is an open-source JavaScript library that helps developers create dynamic user interfaces with a clean underlying data model. It allows for easy binding of HTML elements to data models, enabling automatic updates to the UI whenever the data changes. However, prior to version 3.5.0-beta, knockout is vulnerable to a cross-site scripting (XSS) attack. This vulnerability arises when the web application fails to properly validate user-supplied data before delivering it to users along with other trusted dynamic content.

Vulnerability Detail

The XSS vulnerability in knockout allows an attacker to inject malicious scripts into web pages viewed by users. This can lead to various security risks, such as stealing sensitive user information, performing actions on behalf of the user, or modifying the appearance and behavior of the web application. The vulnerability is rated as moderate severity (CVSS score: 6.1) and is classified under CWE-79 (Cross-Site Scripting).

How To Fix

Minimum fixed version

3.5.0

This is the first release that contains the fix.

npm install knockout@3.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version of knockout is not immediately feasible, a temporary workaround is to manually validate and sanitize user-supplied data before using it in the web application. This can be achieved by implementing proper input validation and output encoding techniques. Here's an example of how to sanitize user input in JavaScript:

function sanitizeInput(input) {
  return input.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

Conclusion

In conclusion, the XSS vulnerability in knockout before version 3.5.0-beta can allow attackers to inject malicious scripts into web pages, posing various security risks. It is crucial to upgrade to the latest version of knockout or implement proper input validation and output encoding techniques to mitigate this vulnerability. For further support and assistance in vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for knockout →

Share this vulnerability

FAQ

Knockout is a JavaScript library used for building dynamic user interfaces with a clean underlying data model. It simplifies the process of binding HTML elements to data models and automatically updating the UI when the data changes.

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by users. These scripts can be used to steal sensitive information, perform actions on behalf of the user, or modify the appearance and behavior of the web application.

The XSS vulnerability in knockout can allow an attacker to execute arbitrary scripts in the context of the web application, potentially leading to the theft of sensitive user information, unauthorized actions, or manipulation of the application's appearance and behavior.

To mitigate this vulnerability, it is recommended to upgrade to version 3.5.0 or later of knockout. Additionally, developers should implement proper input validation and output encoding techniques to sanitize user-supplied data before using it in the application.

Related vulnerabilities

Recent vulnerabilities recorded for knockout.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

3.5.0

This is the first release that contains the fix.

npm install knockout@3.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback