【发布时间】:2021-10-18 11:29:42
【问题描述】:
我正在使用 spring-boot + freemarker(标准初始化项目)。
我的 .ftlh 文件中有一行
<a href="<@spring.url '/${customer.email}' />"
class="zenith-link"
id="use-qr-link">${customer.email}
</a>
但是当我将"><script>alert("Boo!")</script> 作为客户电子邮件注入时,它不会被转义(因此我的应用存在 XSS 漏洞)
有什么方法可以将 HtmlEscape 设置为 true
【问题讨论】:
标签: spring freemarker html-escape-characters