Skip to content
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

Fix code scanning alert no. 6: DOM text reinterpreted as HTML #1547

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

priyankarpal
Copy link
Member

Fixes https://github.com/reactplay/react-play/security/code-scanning/6

To fix the problem, we need to ensure that the value.cover is properly sanitized before being used as the src attribute of an img tag. One way to achieve this is by using a library like DOMPurify to sanitize the input. This will ensure that any potentially malicious content is removed before it is used in the DOM.

  1. Install the DOMPurify library.
  2. Import DOMPurify in the relevant file.
  3. Use DOMPurify.sanitize to sanitize the value.cover before using it as the src attribute.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Priyankar Pal  <[email protected]>
@priyankarpal priyankarpal marked this pull request as ready for review October 10, 2024 14:29
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

@priyankarpal priyankarpal merged commit c1533f8 into main Oct 10, 2024
6 checks passed
@priyankarpal priyankarpal deleted the alert-autofix-6 branch October 10, 2024 14:32
Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for reactplayio ready!

Name Link
🔨 Latest commit 3fb034f
🔍 Latest deploy log https://app.netlify.com/sites/reactplayio/deploys/6707e4c660db760008ec2f9a
😎 Deploy Preview https://deploy-preview-1547--reactplayio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant