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. 4: DOM text reinterpreted as HTML #159

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

xbubbo
Copy link
Member

@xbubbo xbubbo commented Nov 22, 2024

Fixes https://github.com/UseInterstellar/Interstellar-Astro/security/code-scanning/4

To fix the problem, we need to ensure that the PanicLink value is properly sanitized before being used to set window.location.href. We can use the DOMPurify library to sanitize the PanicLink value, ensuring that any potentially malicious content is removed.

  • Import the DOMPurify library if not already imported.
  • Sanitize the PanicLink value using DOMPurify.sanitize before using it to set window.location.href.

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>
@xbubbo xbubbo marked this pull request as ready for review November 22, 2024 02:26
@xbubbo xbubbo merged commit 4b7d022 into main Nov 22, 2024
0 of 2 checks passed
@xbubbo xbubbo deleted the alert-autofix-4 branch November 22, 2024 02:36
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