Skip to content

Commit 019a1b9

Browse files
bmispelonfelixxm
authored andcommitted
[2.2.x] Fixed #31029 -- Used more specific links to RFCs.
Backport of ff1b19d from master
1 parent 57f5a7e commit 019a1b9

File tree

7 files changed

+24
-21
lines changed

7 files changed

+24
-21
lines changed

docs/ref/csrf.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ This ensures that only forms that have originated from trusted domains can be
298298
used to POST data back.
299299

300300
It deliberately ignores GET requests (and other requests that are defined as
301-
'safe' by :rfc:`7231`). These requests ought never to have any potentially
302-
dangerous side effects , and so a CSRF attack with a GET request ought to be
303-
harmless. :rfc:`7231` defines POST, PUT, and DELETE as 'unsafe', and all other
304-
methods are also assumed to be unsafe, for maximum protection.
301+
'safe' by :rfc:`7231#section-4.2.1`). These requests ought never to have any
302+
potentially dangerous side effects, and so a CSRF attack with a GET request
303+
ought to be harmless. :rfc:`7231#section-4.2.1` defines POST, PUT, and DELETE
304+
as 'unsafe', and all other methods are also assumed to be unsafe, for maximum
305+
protection.
305306

306307
The CSRF protection cannot protect against man-in-the-middle attacks, so use
307308
:ref:`HTTPS <security-recommendation-ssl>` with

docs/ref/models/instances.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ in ``get_absolute_url()`` and have all your other code call that one place.
755755

756756
.. note::
757757
The string you return from ``get_absolute_url()`` **must** contain only
758-
ASCII characters (required by the URI specification, :rfc:`2396`) and be
759-
URL-encoded, if necessary.
758+
ASCII characters (required by the URI specification, :rfc:`2396#section-2`)
759+
and be URL-encoded, if necessary.
760760

761761
Code and templates calling ``get_absolute_url()`` should be able to use the
762762
result directly without any further processing. You may wish to use the

docs/ref/request-response.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@ Methods
809809
JavaScript from having access to the cookie.
810810

811811
HttpOnly_ is a flag included in a Set-Cookie HTTP response header. It's
812-
part of the :rfc:`6265` standard for cookies and can be a useful way to
813-
mitigate the risk of a client-side script accessing the protected cookie
814-
data.
812+
part of the :rfc:`RFC 6265 <6265#section-4.1.2.6>` standard for cookies
813+
and can be a useful way to mitigate the risk of a client-side script
814+
accessing the protected cookie data.
815815
* Use ``samesite='Strict'`` or ``samesite='Lax'`` to tell the browser not
816816
to send this cookie when performing a cross-origin request. `SameSite`_
817817
isn't supported by all browsers, so it's not a replacement for Django's
@@ -826,11 +826,11 @@ Methods
826826

827827
.. warning::
828828

829-
:rfc:`6265` states that user agents should support cookies of at least
830-
4096 bytes. For many browsers this is also the maximum size. Django
831-
will not raise an exception if there's an attempt to store a cookie of
832-
more than 4096 bytes, but many browsers will not set the cookie
833-
correctly.
829+
:rfc:`RFC 6265 <6265#section-6.1>` states that user agents should
830+
support cookies of at least 4096 bytes. For many browsers this is also
831+
the maximum size. Django will not raise an exception if there's an
832+
attempt to store a cookie of more than 4096 bytes, but many browsers
833+
will not set the cookie correctly.
834834

835835
.. method:: HttpResponse.set_signed_cookie(key, value, salt='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False, samesite=None)
836836

docs/ref/settings.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2701,7 +2701,7 @@ preference to the ``Host`` header. This should only be enabled if a proxy
27012701
which sets this header is in use.
27022702

27032703
This setting takes priority over :setting:`USE_X_FORWARDED_PORT`. Per
2704-
:rfc:`7239#page-7`, the ``X-Forwarded-Host`` header can include the port
2704+
:rfc:`7239#section-5.3`, the ``X-Forwarded-Host`` header can include the port
27052705
number, in which case you shouldn't use :setting:`USE_X_FORWARDED_PORT`.
27062706

27072707
.. setting:: USE_X_FORWARDED_PORT
@@ -3020,8 +3020,8 @@ Whether to use ``HttpOnly`` flag on the session cookie. If this is set to
30203020
cookie.
30213021

30223022
HttpOnly_ is a flag included in a Set-Cookie HTTP response header. It's part of
3023-
the :rfc:`6265` standard for cookies and can be a useful way to mitigate the
3024-
risk of a client-side script accessing the protected cookie data.
3023+
the :rfc:`6265#section-4.1.2.6` standard for cookies and can be a useful way to
3024+
mitigate the risk of a client-side script accessing the protected cookie data.
30253025

30263026
This makes it less trivial for an attacker to escalate a cross-site scripting
30273027
vulnerability into full hijacking of a user's session. There aren't many good

docs/ref/templates/builtins.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,8 @@ Format character Description Example output
14171417
the "c" formatter will not add timezone
14181418
offset if value is a naive datetime
14191419
(see :class:`datetime.tzinfo`).
1420-
``r`` :rfc:`5322` formatted date. ``'Thu, 21 Dec 2000 16:01:07 +0200'``
1420+
``r`` :rfc:`RFC 5322 <5322#section-3.3>` ``'Thu, 21 Dec 2000 16:01:07 +0200'``
1421+
formatted date.
14211422
``U`` Seconds since the Unix Epoch
14221423
(January 1 1970 00:00:00 UTC).
14231424
================ ======================================== =====================

docs/ref/utils.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ escaping HTML.
720720

721721
.. function:: http_date(epoch_seconds=None)
722722

723-
Formats the time to match the :rfc:`1123` date format as specified by HTTP
724-
:rfc:`7231#section-7.1.1.1`.
723+
Formats the time to match the :rfc:`1123#section-5.2.14` date format as
724+
specified by HTTP :rfc:`7231#section-7.1.1.1`.
725725

726726
Accepts a floating point number expressed in seconds since the epoch in
727727
UTC--such as that outputted by ``time.time()``. If set to ``None``,

docs/ref/validators.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ to, or in lieu of custom ``field.clean()`` methods.
154154
an error code of ``'invalid'`` if it doesn't.
155155

156156
Loopback addresses and reserved IP spaces are considered valid. Literal
157-
IPv6 addresses (:rfc:`2732`) and unicode domains are both supported.
157+
IPv6 addresses (:rfc:`3986#section-3.2.2`) and unicode domains are both
158+
supported.
158159

159160
In addition to the optional arguments of its parent :class:`RegexValidator`
160161
class, ``URLValidator`` accepts an extra optional attribute:

0 commit comments

Comments
 (0)