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. 569: Client-side cross-site scripting #901

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bitpredator
Copy link
Owner

Fixes https://github.com/bitpredator/empiretown/security/code-scanning/569

To fix the problem, we need to ensure that any user-provided data used to construct HTML is properly sanitized or escaped to prevent XSS attacks. The best way to fix this issue without changing existing functionality is to use a library like DOMPurify to sanitize the user-provided data before inserting it into the DOM.

  1. Install the DOMPurify library.
  2. Import DOMPurify in the file.
  3. Use DOMPurify.sanitize to sanitize the user-provided data before constructing the DispatchItem variable.

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

@bitpredator bitpredator added the help wanted Asking for outside help and/or contributions to this particular issue or PR label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Asking for outside help and/or contributions to this particular issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant