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

Potential fix for code scanning alert no. 2: Unsafe jQuery plugin #64

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

ChrisChilders-USDA
Copy link
Collaborator

Potential fix for https://github.com/i5k/i5k.github.io/security/code-scanning/2

To fix the problem, we need to sanitize the mfp.st.closeMarkup property before using it to construct HTML. This can be achieved by using a library like DOMPurify to sanitize the HTML content. We will modify the _getCloseBtn function to sanitize the mfp.st.closeMarkup property before using it.

  1. Import the DOMPurify library.
  2. Use DOMPurify to sanitize the mfp.st.closeMarkup property before using it to create the close button.

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>
@ChrisChilders-USDA ChrisChilders-USDA marked this pull request as ready for review March 19, 2025 12:34
@ChrisChilders-USDA ChrisChilders-USDA merged commit 93c89d1 into master Mar 19, 2025
3 checks passed
@ChrisChilders-USDA ChrisChilders-USDA deleted the alert-autofix-2 branch March 19, 2025 12:34
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