Java Servlet 3.0 规范建议公开 X-Powered-by。这不是安全不良做法吗?

标签 java security servlets servlet-3.0 response-headers

阅读 Servlet 3.0 规范时,我发现了以下内容,想知道这是否真的是推荐的做法。出于安全原因,我记得曾收到建议不要包含此信息:

It is recommended that containers use the X-Powered-By HTTP header to publish its implementation information. The field value should consist of one or more implementation types, such as "Servlet/3.0". Optionally, the supplementary information of the container and the underlying Java platform can be added after the implementation type within parentheses. The container should be configurable to suppress this header. Here's the examples of this header:

X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish v3 JRE/1.6.0)

例如,here ,有人反对这种做法。我曾经使用一种工具来分析我的网站是否存在潜在问题,结果返回了安全警告和删除 X-Powered-By header 的建议。

最佳答案

通过模糊实现的安全是安全的“层”。由于它属于这种情况,最好隐藏该 header 而不是让它暴露。有自动化工具、扫描仪、机器人等会查找特定的服务器响应 header 。如果满足正确的条件,工具/机器人通常会执行其他功能,包括向主机发送漏洞。通过简单地隐藏 header ,您可以防止这些和其他类型的攻击。诚然,易受攻击的应用程序仍然是易受攻击的应用程序。无论如何......重点是,建议删除那些标题。安全性必须分层实现,防止应用程序底层框架的足迹是保护它的许多步骤中的第一步。

关于Java Servlet 3.0 规范建议公开 X-Powered-by。这不是安全不良做法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20570479/

相关文章:

arraylist - ArrayList 的不同实现

Linux 上 Path 变量中的 Java

c# - 覆盖登录页面上的防伪 token 错误

java - 从页面名称中删除 .jsp

java - 如何将字符串从一个jsp传递到另一个jsp,其中每个字符串都在链接中,并通过单击链接方式检索字符串

java - 在其他类中使用对象变量

java - 如何使用 Maven 安装 caldav4j?

c# - 如何抑制 "An application is requesting access to a protected item"弹出窗口

使用应用程序性能监控工具的安全风险

android - 使用 Tomcat 服务器托管 android 和 web 应用程序打开太多连接