-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate url to prevent XSS attacks #2729
Comments
Thank you @gtsp233 - we're aware of a matching vulnerability in the I'll note that this would only be exploitable in Dash apps that include some mechanism to store user input to be reloaded by a different user. Very few public Dash apps do this, but private apps sometimes do. |
@AnnMarieW quite possibly - it depends whether the underlying bootstrap & mantine components do anything to sanitize their inputs. Would you be up for trying them? I'm sure they would be grateful for help demonstrating that this either is or is not an issue. Reproducing in Dash is simple, put |
Hi @alexcjohnson - I just tried it and it's a vulnerability in both libraries. I'll open an issue in each and link it here for more info. |
I've identified a Cross-Site Scripting (XSS) vulnerability in 'dash-core-components'
Vulnerability Details:
Steps to Reproduce:
In a React.js project:
Then the malicious code alert(1) will be executed. Any React.js application using this package may be vulnerable to XSS.
Suggested Fix or Mitigation:
dash/components/dash-core-components/src/components/Link.react.js
Lines 64 to 94 in 000ec18
It is best practice for a React.js components package to sanitize the href attribute before passing it to an tag. React.js and many popular libraries such as react-router-dom and Next.js also ensure the safety of href attributes. For instance, React.js issues warnings about URLs starting with javascript: and is planning to block these in future versions, as indicated in this pull request.
Please consider validating the href to resolve this vulnerability, thanks!
The text was updated successfully, but these errors were encountered: