CVE-2017-1000006: Cross Site Scripting (XSS) in plotly.js
Summary
CVE-2017-1000006: Cross Site Scripting (XSS) in plotly.js. Affects plotly.js versions < 1.16.0. Fixed in 1.16.0. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
plotly.js is an open-source JavaScript graphing library that allows users to create interactive, publication-quality graphs. It is commonly used in web applications to visualize data. However, versions of plotly.js prior to 1.16.0 are vulnerable to cross-site scripting (XSS) attacks. This means that if an attacker can convince a user to visit a malicious plot on a site using this package, they can execute arbitrary code in the user's browser.
Vulnerability Detail
The vulnerability in plotly.js arises from insufficient input sanitization, allowing an attacker to inject malicious scripts into the generated plots. When a user interacts with the plot, the injected script will execute in the user's browser context, potentially leading to session hijacking, data theft, or other malicious activities. This vulnerability has a CVSS score of 6.1, indicating a moderate severity level.
How To Fix
Minimum fixed version
1.16.0
This is the first release that contains the fix.
npm install plotly.js@1.16.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating to the latest version of plotly.js is not feasible, a temporary workaround is to manually sanitize user input before passing it to the library. This can be done by using a trusted HTML sanitization library or by implementing custom input validation and sanitization logic. Here is an example of how to sanitize user input using the DOMPurify library:
const sanitizedInput = DOMPurify.sanitize(userInput);
Conclusion
In conclusion, plotly.js versions prior to 1.16.0 are vulnerable to cross-site scripting (XSS) attacks. To protect your application, it is crucial to update to the latest version of plotly.js or apply manual input sanitization. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for plotly.js →
FAQ
Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. These scripts can be used to steal sensitive information, manipulate user interactions, or perform other malicious actions.
An attacker can exploit this vulnerability by creating a malicious plot using plotly.js and convincing a user to visit a page containing the plot. When the user interacts with the plot, the injected script will execute in their browser, giving the attacker control over the user's session or allowing them to steal sensitive information.
The impact of this vulnerability can vary depending on the actions performed by the injected script. Possible consequences include session hijacking, data theft, unauthorized access to user accounts, and manipulation of user interactions.
Yes, this vulnerability has been fixed in plotly.js version 1.16.0. It is recommended to update to this version or later to ensure the security of your application.
The primary mitigation for this vulnerability is to update plotly.js to the latest version. Additionally, implementing input validation and sanitization measures can help mitigate the risk of XSS attacks in general.