Skip to content

Commit b919ece

Browse files
committed
Change Idempotent to Read-Only
Closes gh-13644
1 parent 11a2189 commit b919ece

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

docs/modules/ROOT/pages/features/exploits/csrf.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ Spring provides two mechanisms to protect against CSRF attacks:
9797

9898
[NOTE]
9999
====
100-
Both protections require that <<Safe Methods Must be Idempotent>>
100+
Both protections require that <<Safe Methods Must be Read-only>>
101101
====
102102

103-
[[csrf-protection-idempotent]]
104-
=== Safe Methods Must be Idempotent
103+
[[csrf-protection-read-only]]
104+
=== Safe Methods Must be Read-only
105105

106-
In order for <<csrf-protection,either protection>> against CSRF to work, the application must ensure that https://tools.ietf.org/html/rfc7231#section-4.2.1["safe" HTTP methods are idempotent].
106+
In order for <<csrf-protection,either protection>> against CSRF to work, the application must ensure that https://tools.ietf.org/html/rfc7231#section-4.2.1["safe" HTTP methods are read-only].
107107
This means that requests with the HTTP method `GET`, `HEAD`, `OPTIONS`, and `TRACE` should not change the state of the application.
108108

109109
[[csrf-protection-stp]]
@@ -119,7 +119,7 @@ For example, requiring the actual CSRF token in an HTTP parameter or an HTTP hea
119119
Requiring the actual CSRF token in a cookie does not work because cookies are automatically included in the HTTP request by the browser.
120120

121121
We can relax the expectations to only require the actual CSRF token for each HTTP request that updates state of the application.
122-
For that to work, our application must ensure that <<csrf-protection-idempotent,safe HTTP methods are idempotent>>.
122+
For that to work, our application must ensure that <<csrf-protection-read-only,safe HTTP methods are read-only>>.
123123
This improves usability since we want to allow linking to our website using links from external sites.
124124
Additionally, we do not want to include the random token in HTTP GET as this can cause the tokens to be leaked.
125125

@@ -190,7 +190,7 @@ Valid values for the `SameSite` attribute are:
190190

191191
* `Strict` - when specified any request coming from the https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1[same-site] will include the cookie.
192192
Otherwise, the cookie will not be included in the HTTP request.
193-
* `Lax` - when specified cookies will be sent when coming from the https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1[same-site] or when the request comes from top-level navigations and the <<Safe Methods Must be Idempotent,method is idempotent>>.
193+
* `Lax` - when specified cookies will be sent when coming from the https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1[same-site] or when the request comes from top-level navigations and the <<Safe Methods Must be Read-only,method is read-only>>.
194194
Otherwise, the cookie will not be included in the HTTP request.
195195

196196
Let's take a look at how <<csrf-explained,our example>> could be protected using the `SameSite` attribute.

docs/modules/ROOT/pages/migration/servlet/exploits.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In Spring Security 6, the default is that the lookup of the `CsrfToken` will be
1717
[NOTE]
1818
====
1919
The `CsrfToken` is needed whenever a request is made with an HTTP verb that would change the state of the application.
20-
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-idempotent[Safe Methods Must be Idempotent].
20+
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-read-only[Safe Methods Must be Read-only].
2121
Additionally, it is needed by any request that renders the token to the response, such as a web page with a `<form>` tag that includes a hidden `<input>` for the CSRF token.
2222
====
2323

docs/modules/ROOT/pages/reactive/exploits/csrf.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ This section discusses Spring Security's xref:features/exploits/csrf.adoc#csrf[C
77
== Using Spring Security CSRF Protection
88
The steps to using Spring Security's CSRF protection are outlined below:
99

10-
* <<webflux-csrf-idempotent,Use proper HTTP verbs>>
10+
* <<webflux-csrf-read-only,Use proper HTTP verbs>>
1111
* <<webflux-csrf-configure,Configure CSRF Protection>>
1212
* <<webflux-csrf-include,Include the CSRF Token>>
1313

14-
[[webflux-csrf-idempotent]]
14+
[[webflux-csrf-read-only]]
1515
=== Use proper HTTP verbs
1616
The first step to protecting against CSRF attacks is to ensure your website uses proper HTTP verbs.
17-
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-idempotent[Safe Methods Must be Idempotent].
17+
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-read-only[Safe Methods Must be Read-only].
1818

1919
[[webflux-csrf-configure]]
2020
=== Configure CSRF Protection

docs/modules/ROOT/pages/servlet/exploits/csrf.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ This section discusses Spring Security's xref:features/exploits/csrf.adoc#csrf[C
77
== Using Spring Security CSRF Protection
88
The steps to using Spring Security's CSRF protection are outlined below:
99

10-
* <<servlet-csrf-idempotent,Use proper HTTP verbs>>
10+
* <<servlet-csrf-read-only,Use proper HTTP verbs>>
1111
* <<servlet-csrf-configure,Configure CSRF Protection>>
1212
* <<servlet-csrf-include,Include the CSRF Token>>
1313

14-
[[servlet-csrf-idempotent]]
14+
[[servlet-csrf-read-only]]
1515
=== Use proper HTTP verbs
1616
The first step to protecting against CSRF attacks is to ensure your website uses proper HTTP verbs.
17-
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-idempotent[Safe Methods Must be Idempotent].
17+
This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-read-only[Safe Methods Must be Read-only].
1818

1919
[[servlet-csrf-configure]]
2020
=== Configure CSRF Protection

0 commit comments

Comments
 (0)