Skip to content

Potential fix for code scanning alert no. 5: Incomplete multi-character sanitization - #1403

Merged
Ffloriel merged 1 commit into
mainfrom
alert-autofix-5
Dec 2, 2025
Merged

Ffloriel merged 1 commit into
mainfrom
alert-autofix-5

Conversation

@Ffloriel

@Ffloriel Ffloriel commented Dec 2, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/FullHuman/purgecss/security/code-scanning/5

To fix the problem, we need to ensure that all instances of <style> tags and their content are removed from the input string, even if they are nested or malformed. The best way to achieve this is to apply the regular expression replacement repeatedly until no more replacements can be performed. This ensures that all instances are effectively removed.

Steps to fix:

  1. Modify the defaultExtractor function to repeatedly apply the regular expression replacement until no more replacements occur.
  2. Ensure that the function returns the sanitized content.

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

…er sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Ffloriel
Ffloriel marked this pull request as ready for review December 2, 2025 19:29
@Ffloriel
Ffloriel merged commit 3f39411 into main Dec 2, 2025
5 checks passed
@Ffloriel
Ffloriel deleted the alert-autofix-5 branch May 2, 2026 15:14
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