【问题标题】:Spring - MVC - Sanitize URL before redisplaying to the userSpring - MVC - 在重新显示给用户之前清理 URL
【发布时间】:2012-04-06 11:53:32
【问题描述】:

在我的应用程序中,带有脚本标记的应用程序的 HTTP GET 请求 URL 正在重新显示,尽管它未通过授权。

示例:http://www.example.com/welcome<script>alert("hi")</script>

问题是通过修改现有的 GET URL 来清理直接输入地址栏的外部输入。 Spring 按原样重新显示提交的 URL。

虽然脚本没有在浏览器 (FF) 中执行,但在将其显示给用户之前,是否有办法去除这些值的 URL

参考:Spring MVC application filtering HTML in URL - Is this a security issue?

【问题讨论】:

    标签: java spring spring-mvc


    【解决方案1】:

    @Raghav..此链接可能对您有所帮助Spring - Rewrite one URL to another,它讨论了一个在 spring 之外的 url 重写库..但似乎可以使用 spring 轻松配置。

    【讨论】:

    • 谢谢。这个工具看起来很棒。
    猜你喜欢
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 2012-04-24
    • 2019-03-07
    • 2013-11-28
    • 2015-10-31
    • 1970-01-01
    • 2021-11-15
    相关资源
    最近更新 更多