为什么网络服务器需要依靠“主机”标题?

发布于 2025-01-30 11:28:46 字数 503 浏览 3 评论 0原文

我正在尝试了解HTTP(S)标题主机引起的漏洞。我听说Web服务员可以通过传入的请求来使用host标题的值,以执行不同的操作,例如构造URL。例如,这里是摘录摘自

django使用客户提供的主机标头在某些情况下构建URL。

我知道HTTP请求中的任何信息都可能不信任。 Web服务器知道他们背后的主机名。那么,为什么他们会从host标题中拿出它,如果他们可以手动配置其主机名,则无法信任呢?

I'm trying to understand vulnerabilities arising from HTTP(S) header Host. I heard that webservers may use the value of the Host header from incoming requests to do different stuff such as constructing URLs. For example here is a excerpt from Django documentation:

Django uses the Host header provided by the client to construct URLs in certain cases.

I know that any information in HTTP(S) requests may not be trusted. Web servers know what host name they are behind. So why would they take it from Host header that cannot be trusted if they can have their host name configured manually?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文