Skip to content

Conversation

@Ffloriel
Copy link
Member

@Ffloriel Ffloriel commented Dec 2, 2025

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
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