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. 1: DOM text reinterpreted as HTML #389

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

zkz098
Copy link
Member

@zkz098 zkz098 commented Jan 29, 2025

Potential fix for https://github.com/theme-shoka-x/hexo-theme-shokaX/security/code-scanning/1

To fix the problem, we need to ensure that the data-src attribute value is properly sanitized or escaped before being used to construct the HTML string. The best way to fix this without changing existing functionality is to use a library like DOMPurify to sanitize the data-src value. This will ensure that any potentially malicious content is neutralized before it is used in the HTML string.

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

…s HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: zkz098 <92242020+zkz098@users.noreply.github.com>
@zkz098 zkz098 marked this pull request as ready for review January 29, 2025 14:48
@zkz098 zkz098 merged commit 88b050e into main Jan 29, 2025
3 checks passed
@zkz098 zkz098 deleted the alert-autofix-1 branch January 29, 2025 14:53
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