You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The same pattern can be found across these two packages. Please consider validating the href to resolve this vulnerability, Thanks!
The text was updated successfully, but these errors were encountered:
I've identified Cross-Site Scripting (XSS) vulnerabilities in '@financial-times/dotcom-ui-header' and '@financial-times-dotcom-ui-footer'
Vulnerability Details:
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:
dotcom-page-kit/packages/dotcom-ui-header/src/components/navigation/partials.tsx
Lines 58 to 77 in b33c591
dotcom-page-kit/packages/dotcom-ui-header/src/components/navigation/partials.tsx
Line 157 in b33c591
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.
The same pattern can be found across these two packages. Please consider validating the href to resolve this vulnerability, Thanks!
The text was updated successfully, but these errors were encountered: