2014年5月14日
Django 1.5.8在1.5.8中修复了两个安全问题。
在某些情况下,Django可以允许缓存存储与特定会话相关的私有数据,然后将该数据提供给具有不同会话或根本没有会话的请求。这可能导致信息泄漏,并可能成为缓存中毒的媒介。
使用django会话时,django将设置 Vary: Cookie
头,以确保缓存不为来自其他会话的请求提供缓存数据。但是,旧版本的Internet Explorer(如果在Windows XP或Windows Server 2003上运行,则很可能只有Internet Explorer 6和Internet Explorer 7)无法处理 Vary
与许多内容类型组合的标题。因此,如果请求是由Internet Explorer发出的,Django将删除头。
为了解决这个问题,删除了这些旧的Internet Explorer版本的特殊行为,并且 Vary
头不再从响应中剥离。此外,对 Cache-Control
所有Internet Explorer请求的标题 Content-Disposition
收割台也已被移除,因为发现它们存在类似问题。
重定向验证没有正确验证某些浏览器接受的格式错误的URL。这允许用户意外地重定向到不安全的URL。
Django relies on user input in some cases (e.g.
django.contrib.auth.views.login()
, django.contrib.comments
, and
i18n) to redirect the user to an "on success" URL.
The security checks for these redirects (namely
django.utils.http.is_safe_url()
) did not correctly validate some malformed
URLs, such as http:\\\\\\djangoproject.com
, which are accepted by some
browsers with more liberal URL parsing.
为了解决这个问题,在 is_safe_url()
已经收紧,以便能够处理和正确验证这些格式错误的URL。
7月 22, 2024