Skip to content

Fix code scanning alert no. 9: Unsafe HTML constructed from library input#34

Merged
aksharahegde merged 1 commit intomainfrom
alert-autofix-9
Dec 19, 2024
Merged

Fix code scanning alert no. 9: Unsafe HTML constructed from library input#34
aksharahegde merged 1 commit intomainfrom
alert-autofix-9

Conversation

@aksharahegde
Copy link
Owner

Fixes https://github.com/aksharahegde/django-jet-3-calm/security/code-scanning/9

To fix the problem, we need to ensure that any user input 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 input before using it in the HTML construction.

  1. Import the DOMPurify library.
  2. Sanitize the closeButtonText, nowButtonText, and deselectButtonText before using them in the HTML construction.

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

…nput

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aksharahegde aksharahegde marked this pull request as ready for review December 19, 2024 15:39
@aksharahegde aksharahegde merged commit 44f50d3 into main Dec 19, 2024
4 checks passed
@aksharahegde aksharahegde deleted the alert-autofix-9 branch December 19, 2024 15:42
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