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

Closed
wants to merge 1 commit into from

Conversation

bitpredator
Copy link
Owner

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

To fix the problem, we need to ensure that any user-provided data is properly sanitized or escaped before being inserted into the HTML. The best way to do this is to use a library that provides functions for escaping HTML entities, such as DOMPurify or he.

In this case, we will use the he library to escape the user-provided data before inserting it into the HTML. This will prevent any malicious scripts from being executed.

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>
@bitpredator bitpredator added the help wanted Asking for outside help and/or contributions to this particular issue or PR label Nov 18, 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