Django 1.9.3 版本发行说明
Django 1.9.3 fixes two security issues and several bugs in 1.9.2.
Django relies on user input in some cases (e.g. and i18n) to redirect the user to an “on success” URL. The security check for these redirects (namely django.utils.http.is_safe_url()
) considered some URLs with basic authentication credentials “safe” when they shouldn’t be.
Also, if a developer relies on is_safe_url()
to provide safe redirect targets and puts such a URL into a link, they could suffer from an XSS attack.
In each major version of Django since 1.6, the default number of iterations for the PBKDF2PasswordHasher
and its subclasses has increased. This improves the security of the password as the speed of hardware increases, however, it also creates a timing difference between a login request for a user with a password encoded in an older number of iterations and login request for a nonexistent user (which runs the default hasher’s default number of iterations since Django 1.6).
The new BasePasswordHasher.harden_runtime()
method allows hashers to bridge the runtime gap between the work factor (e.g. iterations) supplied in existing encoded passwords and the default work factor of the hasher. This method is implemented for PBKDF2PasswordHasher
and BCryptPasswordHasher
. The number of rounds for the latter hasher hasn’t changed since Django 1.4, but some projects may subclass it and increase the work factor as needed.
A warning will be emitted for any a method.
- Skipped URL checks (new in 1.9) if the
ROOT_URLCONF
setting isn’t defined (#26155). - Fixed a crash on PostgreSQL that prevented using
TIME_ZONE=None
andUSE_TZ=False
(). - Fixed a regression for cases where
ForeignObject.get_extra_descriptor_filter()
returned aQ
object (#26153). - Fixed regression with an
__in=qs
lookup for aForeignKey
withto_field
set (). - Made
forms.FileField
and picklable (#26212). - Fixed and ArrayField serialization with
None
values (). - Fixed a crash when filtering by a
Decimal
inRawQuery
(#26219). - Fixed some crashing deprecation shims in
SimpleTemplateResponse
that regressed in Django 1.9 (). - Fixed
BoundField
to reallow slices of subwidgets (#26267). - Changed the admin’s “permission denied” message in the login template to use
get_username
instead ofusername
to support custom user models (). - Fixed a crash when passing a nonexistent template name to the cached template loader’s
load_template()
method (#26280). - Prevented instances from sharing their cache ().