Skip to content

Conversation

@Ohswedd
Copy link
Collaborator

@Ohswedd Ohswedd commented Nov 30, 2024

Fixes https://github.com/altxriainc/kromacss/security/code-scanning/1

To fix the problem, we need to ensure that any text inserted into the HTML is properly escaped to prevent XSS attacks. Instead of using innerHTML, which can interpret the text as HTML, we should use textContent to safely insert the text as plain text.

  • Replace the use of innerHTML with textContent for inserting the file name.
  • Ensure that the button element is created and appended separately to avoid using innerHTML.

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>
@Ohswedd Ohswedd marked this pull request as ready for review November 30, 2024 14:03
@Ohswedd Ohswedd merged commit a0b4f26 into main Nov 30, 2024
3 checks passed
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.

2 participants