This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Cross-Site Scripting (XSS) : issue fix by sanitizing strings before rendering #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📊 Metadata *
zingchart-react is vulnerable to Cross-Site Scripting (XSS).
Bounty URL: https://www.huntr.dev/bounties/1-npm-zingchart-react
⚙️ Description *
Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.
💻 Technical Description *
Cross-Site Scripting (XSS) attacks are mitigated by sanitizing the user inputs before rendering, thereby preventing malicious execution.
🐛 Proof of Concept (PoC) *
Open https://github.com/zingchart/zingchart-react
Open link in about https://www.zingchart.com/docs/integrations/react
Open in Sandbox https://codesandbox.io/s/zingchart-react-wrapper-example-dxfc9?from-embed
Insert the xss payload in any of the values field in series in Simple.jsx. EX:
values: [4, '><img src=x onerror=alert(1)>', 3, 4, 5, 3, 5, 4, 11]
XSS payload will get executed.
🔥 Proof of Fix (PoF) *
Before:
After:
👍 User Acceptance Testing (UAT)
After the fix, functionality is unaffected.