fix(web): harden legal script sanitization#3855
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe iterative script-tag removal loop correctly addresses the nested-tag bypass (CodeQL alert 430) and terminates safely — no bugs, security regressions, or performance concerns found in the two changed files. Files Reviewed (2 files)
Loop correctness: Each iteration of the Attack vector coverage: The regression test correctly exercises the bypass: Scope: Fix these issues in Kilo Cloud Reviewed by claude-4.6-sonnet-20260217 · 392,843 tokens Review guidance: REVIEW.md from base branch |
|
|
||
| do { | ||
| previousHtml = sanitizedHtml; | ||
| sanitizedHtml = sanitizedHtml.replaceAll(/<script\b[^>]*>[\s\S]*?<\/script>/gi, ''); |
Summary
<script>elements until malformed nested tags can no longer reintroduce a script tag.Verification
Visual Changes
N/A
Reviewer Notes