csrf.adoc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. [[servlet-csrf]]
  2. = Cross Site Request Forgery (CSRF) for Servlet Environments
  3. This section discusses Spring Security's xref:features/exploits/csrf.adoc#csrf[Cross Site Request Forgery (CSRF)] support for servlet environments.
  4. [[servlet-csrf-using]]
  5. == Using Spring Security CSRF Protection
  6. The steps to using Spring Security's CSRF protection are outlined below:
  7. * <<servlet-csrf-idempotent>>
  8. * <<servlet-csrf-configure>>
  9. * <<servlet-csrf-include>>
  10. [[servlet-csrf-idempotent]]
  11. === Use proper HTTP verbs
  12. The first step to protecting against CSRF attacks is to ensure that your website uses proper HTTP verbs.
  13. This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-idempotent[Safe Methods Must be Idempotent].
  14. [[servlet-csrf-configure]]
  15. === Configure CSRF Protection
  16. The next step is to configure Spring Security's CSRF protection within your application.
  17. Spring Security's CSRF protection is enabled by default, but you may need to customize the configuration.
  18. The next few sections cover a few common customizations.
  19. [[servlet-csrf-configure-custom-repository]]
  20. ==== Custom CsrfTokenRepository
  21. By default, Spring Security stores the expected CSRF token in the `HttpSession` by using `HttpSessionCsrfTokenRepository`.
  22. There can be cases where users want to configure a custom `CsrfTokenRepository`.
  23. For example, it might be desirable to persist the `CsrfToken` in a cookie to <<servlet-csrf-include-ajax-auto,support a JavaScript-based application>>.
  24. By default, the `CookieCsrfTokenRepository` writes to a cookie named `XSRF-TOKEN` and reads it from a header named `X-XSRF-TOKEN` or the HTTP parameter `_csrf`.
  25. These defaults come from https://docs.angularjs.org/api/ng/service/$http#cross-site-request-forgery-xsrf-protection[AngularJS].
  26. You can configure `CookieCsrfTokenRepository` in XML byusing the following:
  27. .Store CSRF Token in a Cookie with XML Configuration
  28. [source,xml]
  29. ----
  30. <http>
  31. <!-- ... -->
  32. <csrf token-repository-ref="tokenRepository"/>
  33. </http>
  34. <b:bean id="tokenRepository"
  35. class="org.springframework.security.web.csrf.CookieCsrfTokenRepository"
  36. p:cookieHttpOnly="false"/>
  37. ----
  38. [NOTE]
  39. ====
  40. The sample explicitly sets `cookieHttpOnly=false`.
  41. This is necessary to allow JavaScript (such as AngularJS) to read it.
  42. If you do not need the ability to read the cookie with JavaScript directly, we recommend omitting `cookieHttpOnly=false` to improve security.
  43. ====
  44. You can configure `CookieCsrfTokenRepository` in Java or Kotlin configuration by using:
  45. .Store CSRF Token in a Cookie
  46. [tabs]
  47. ======
  48. Java::
  49. +
  50. [source,java,role="primary"]
  51. ----
  52. @Configuration
  53. @EnableWebSecurity
  54. public class WebSecurityConfig {
  55. @Bean
  56. public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
  57. http
  58. .csrf(csrf -> csrf
  59. .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
  60. );
  61. return http.build();
  62. }
  63. }
  64. ----
  65. Kotlin::
  66. +
  67. [source,kotlin,role="secondary"]
  68. ----
  69. @Configuration
  70. @EnableWebSecurity
  71. class SecurityConfig {
  72. @Bean
  73. open fun filterChain(http: HttpSecurity): SecurityFilterChain {
  74. http {
  75. csrf {
  76. csrfTokenRepository = CookieCsrfTokenRepository.withHttpOnlyFalse()
  77. }
  78. }
  79. return http.build()
  80. }
  81. }
  82. ----
  83. ======
  84. [NOTE]
  85. ====
  86. The sample explicitly sets `cookieHttpOnly=false`.
  87. This is necessary to let JavaScript (such as AngularJS) read it.
  88. If you do not need the ability to read the cookie with JavaScript directly, we recommend omitting `cookieHttpOnly=false` (by using `new CookieCsrfTokenRepository()` instead) to improve security.
  89. ====
  90. [[servlet-csrf-configure-disable]]
  91. ==== Disable CSRF Protection
  92. By default, CSRF protection is enabled.
  93. However, you can disable CSRF protection if it xref:features/exploits/csrf.adoc#csrf-when[makes sense for your application].
  94. The following XML configuration disables CSRF protection:
  95. .Disable CSRF XML Configuration
  96. [source,xml]
  97. ----
  98. <http>
  99. <!-- ... -->
  100. <csrf disabled="true"/>
  101. </http>
  102. ----
  103. The following Java or Kotlin configuration disables CSRF protection:
  104. .Disable CSRF
  105. [tabs]
  106. ======
  107. Java::
  108. +
  109. [source,java,role="primary"]
  110. ----
  111. @Configuration
  112. @EnableWebSecurity
  113. public class WebSecurityConfig {
  114. @Bean
  115. public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
  116. http
  117. .csrf(csrf -> csrf.disable());
  118. return http.build();
  119. }
  120. }
  121. ----
  122. Kotlin::
  123. +
  124. [source,kotlin,role="secondary"]
  125. ----
  126. @Configuration
  127. @EnableWebSecurity
  128. class SecurityConfig {
  129. @Bean
  130. open fun filterChain(http: HttpSecurity): SecurityFilterChain {
  131. http {
  132. csrf {
  133. disable()
  134. }
  135. }
  136. return http.build()
  137. }
  138. }
  139. ----
  140. ======
  141. [[servlet-csrf-configure-request-handler]]
  142. ==== Configure CsrfTokenRequestHandler
  143. Spring Security's https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/web/csrf/CsrfFilter.html[`CsrfFilter`] exposes a https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/web/csrf/CsrfToken.html[`CsrfToken`] as an `HttpServletRequest` attribute named `_csrf` with the help of a https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/web/csrf/CsrfTokenRequestHandler.html[CsrfTokenRequestHandler].
  144. In 5.8, the default implementation was `CsrfTokenRequestAttributeHandler` which simply makes the `_csrf` attribute available as a request attribute.
  145. As of 6.0, the default implementation is `XorCsrfTokenRequestAttributeHandler`, which provides protection for BREACH (see https://github.com/spring-projects/spring-security/issues/4001[gh-4001]).
  146. If you wish to disable BREACH protection of the `CsrfToken` and revert to the 5.8 default, you can configure `CsrfTokenRequestAttributeHandler` in XML using the following:
  147. .Disable BREACH protection XML Configuration
  148. [source,xml]
  149. ----
  150. <http>
  151. <!-- ... -->
  152. <csrf request-handler-ref="requestHandler"/>
  153. </http>
  154. <b:bean id="requestHandler"
  155. class="org.springframework.security.web.csrf.CsrfTokenRequestAttributeHandler"/>
  156. ----
  157. You can configure `CsrfTokenRequestAttributeHandler` in Java Configuration using the following:
  158. .Disable BREACH protection
  159. [tabs]
  160. ======
  161. Java::
  162. +
  163. [source,java,role="primary"]
  164. ----
  165. @EnableWebSecurity
  166. public class WebSecurityConfig {
  167. @Bean
  168. public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
  169. http
  170. .csrf(csrf -> csrf
  171. .csrfTokenRequestHandler(new CsrfTokenRequestAttributeHandler())
  172. );
  173. return http.build();
  174. }
  175. }
  176. ----
  177. Kotlin::
  178. +
  179. [source,kotlin,role="secondary"]
  180. ----
  181. @EnableWebSecurity
  182. class SecurityConfig {
  183. @Bean
  184. open fun filterChain(http: HttpSecurity): SecurityFilterChain {
  185. http {
  186. csrf {
  187. csrfTokenRequestHandler = CsrfTokenRequestAttributeHandler()
  188. }
  189. }
  190. return http.build()
  191. }
  192. }
  193. ----
  194. ======
  195. [[servlet-csrf-include]]
  196. === Include the CSRF Token
  197. For the xref:features/exploits/csrf.adoc#csrf-protection-stp[synchronizer token pattern] to protect against CSRF attacks, we must include the actual CSRF token in the HTTP request.
  198. This must be included in a part of the request (a form parameter, an HTTP header, or other part) that is not automatically included in the HTTP request by the browser.
  199. <<servlet-csrf-configure-request-handler,We've seen>> that the `CsrfToken` is exposed as a request attribute.
  200. This means that any view technology can access the `CsrfToken` to expose the expected token as either a <<servlet-csrf-include-form-attr,form>> or <<servlet-csrf-include-ajax-meta-attr,meta tag>>.
  201. Fortunately, there are integrations listed later in this chapter that make including the token in <<servlet-csrf-include-form,form>> and <<servlet-csrf-include-ajax,ajax>> requests even easier.
  202. [[servlet-csrf-include-form]]
  203. ==== Form URL Encoded
  204. To post an HTML form, the CSRF token must be included in the form as a hidden input.
  205. For example, the rendered HTML might look like:
  206. .CSRF Token HTML
  207. [source,html]
  208. ----
  209. <input type="hidden"
  210. name="_csrf"
  211. value="4bfd1575-3ad1-4d21-96c7-4ef2d9f86721"/>
  212. ----
  213. Next, we discuss various ways of including the CSRF token in a form as a hidden input.
  214. [[servlet-csrf-include-form-auto]]
  215. ===== Automatic CSRF Token Inclusion
  216. Spring Security's CSRF support provides integration with Spring's https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/support/RequestDataValueProcessor.html[`RequestDataValueProcessor`] through its https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/web/servlet/support/csrf/CsrfRequestDataValueProcessor.html[`CsrfRequestDataValueProcessor`].
  217. This means that, if you use https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-view-jsp-formtaglib[Spring’s form tag library], https://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html#integration-with-requestdatavalueprocessor[Thymeleaf], or any other view technology that integrates with `RequestDataValueProcessor`, then forms that have an unsafe HTTP method (such as post) automatically include the actual CSRF token.
  218. [[servlet-csrf-include-form-tag]]
  219. ===== csrfInput Tag
  220. If you use JSPs, you can use https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-view-jsp-formtaglib[Spring’s form tag library].
  221. However, if that is not an option, you can also include the token with the xref:servlet/integrations/jsp-taglibs.adoc#taglibs-csrfinput[csrfInput] tag.
  222. [[servlet-csrf-include-form-attr]]
  223. ===== CsrfToken Request Attribute
  224. If the <<servlet-csrf-include,other options>> for including the actual CSRF token in the request do not work, you can take advantage of the fact that the `CsrfToken` <<servlet-csrf-include,is exposed>> as an `HttpServletRequest` attribute named `_csrf`.
  225. The following example does this with a JSP:
  226. .CSRF Token in Form with Request Attribute
  227. [source,xml]
  228. ----
  229. <c:url var="logoutUrl" value="/logout"/>
  230. <form action="${logoutUrl}"
  231. method="post">
  232. <input type="submit"
  233. value="Log out" />
  234. <input type="hidden"
  235. name="${_csrf.parameterName}"
  236. value="${_csrf.token}"/>
  237. </form>
  238. ----
  239. [[servlet-csrf-include-ajax]]
  240. ==== Ajax and JSON Requests
  241. If you use JSON, you cannot submit the CSRF token within an HTTP parameter.
  242. Instead, you can submit the token within a HTTP header.
  243. The following sections discuss various ways of including the CSRF token as an HTTP request header in JavaScript based applications.
  244. [[servlet-csrf-include-ajax-auto]]
  245. ===== Automatic Inclusion
  246. You can <<servlet-csrf-configure-custom-repository,configure>> Spring Security to store the expected CSRF token in a cookie.
  247. By storing the expected CSRF in a cookie, JavaScript frameworks, such as https://docs.angularjs.org/api/ng/service/$http#cross-site-request-forgery-xsrf-protection[AngularJS], automatically include the actual CSRF token in the HTTP request headers.
  248. [[servlet-csrf-include-ajax-meta]]
  249. ===== Meta Tags
  250. An alternative pattern to <<servlet-csrf-include-form-auto,exposing the CSRF in a cookie>> is to include the CSRF token within your `meta` tags.
  251. The HTML might look something like this:
  252. .CSRF meta tag HTML
  253. [source,html]
  254. ----
  255. <html>
  256. <head>
  257. <meta name="_csrf" content="4bfd1575-3ad1-4d21-96c7-4ef2d9f86721"/>
  258. <meta name="_csrf_header" content="X-CSRF-TOKEN"/>
  259. <!-- ... -->
  260. </head>
  261. <!-- ... -->
  262. ----
  263. Once the meta tags contain the CSRF token, the JavaScript code can read the meta tags and include the CSRF token as a header.
  264. If you use jQuery, you can do this with the following code:
  265. .AJAX send CSRF Token
  266. [source,javascript]
  267. ----
  268. $(function () {
  269. var token = $("meta[name='_csrf']").attr("content");
  270. var header = $("meta[name='_csrf_header']").attr("content");
  271. $(document).ajaxSend(function(e, xhr, options) {
  272. xhr.setRequestHeader(header, token);
  273. });
  274. });
  275. ----
  276. [[servlet-csrf-include-ajax-meta-tag]]
  277. ====== csrfMeta tag
  278. If you use JSPs, one way to write the CSRF token to the `meta` tags is by using the xref:servlet/integrations/jsp-taglibs.adoc#taglibs-csrfmeta[csrfMeta] tag.
  279. [[servlet-csrf-include-ajax-meta-attr]]
  280. ====== CsrfToken Request Attribute
  281. If the <<servlet-csrf-include,other options>> for including the actual CSRF token in the request do not work, you can take advantage of the fact that the `CsrfToken` <<servlet-csrf-include,is exposed>> as an `HttpServletRequest` attribute named `_csrf`.
  282. The following example does this with a JSP:
  283. .CSRF meta tag JSP
  284. [source,html]
  285. ----
  286. <html>
  287. <head>
  288. <meta name="_csrf" content="${_csrf.token}"/>
  289. <!-- default header name is X-CSRF-TOKEN -->
  290. <meta name="_csrf_header" content="${_csrf.headerName}"/>
  291. <!-- ... -->
  292. </head>
  293. <!-- ... -->
  294. ----
  295. [[servlet-csrf-considerations]]
  296. == CSRF Considerations
  297. There are a few special considerations to consider when implementing protection against CSRF attacks.
  298. This section discusses those considerations as they pertain to servlet environments.
  299. See xref:features/exploits/csrf.adoc#csrf-considerations[CSRF Considerations] for a more general discussion.
  300. [[servlet-considerations-csrf-login]]
  301. === Logging In
  302. It is important to xref:features/exploits/csrf.adoc#csrf-considerations-login[require CSRF for log in] requests to protect against forging log in attempts.
  303. Spring Security's servlet support does this out of the box.
  304. [[servlet-considerations-csrf-logout]]
  305. === Logging Out
  306. It is important to xref:features/exploits/csrf.adoc#csrf-considerations-logout[require CSRF for log out] requests to protect against forging logout attempts.
  307. If CSRF protection is enabled (the default), Spring Security's `LogoutFilter` to only process HTTP POST.
  308. This ensures that logging out requires a CSRF token and that a malicious user cannot forcibly log out your users.
  309. The easiest approach is to use a form to log out.
  310. If you really want a link, you can use JavaScript to have the link perform a POST (maybe on a hidden form).
  311. For browsers with JavaScript that is disabled, you can optionally have the link take the user to a log out confirmation page that performs the POST.
  312. If you really want to use HTTP GET with logout, you can do so. However, remember that this is generally not recommended.
  313. For example, the following Java Configuration logs out when the `/logout` URL is requested with any HTTP method:
  314. .Log out with any HTTP method
  315. [tabs]
  316. ======
  317. Java::
  318. +
  319. [source,java,role="primary"]
  320. ----
  321. @Configuration
  322. @EnableWebSecurity
  323. public class WebSecurityConfig {
  324. @Bean
  325. public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
  326. http
  327. .logout(logout -> logout
  328. .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
  329. );
  330. return http.build();
  331. }
  332. }
  333. ----
  334. Kotlin::
  335. +
  336. [source,kotlin,role="secondary"]
  337. ----
  338. @Configuration
  339. @EnableWebSecurity
  340. class SecurityConfig {
  341. @Bean
  342. open fun filterChain(http: HttpSecurity): SecurityFilterChain {
  343. http {
  344. logout {
  345. logoutRequestMatcher = AntPathRequestMatcher("/logout")
  346. }
  347. }
  348. return http.build()
  349. }
  350. }
  351. ----
  352. ======
  353. [[servlet-considerations-csrf-timeouts]]
  354. === CSRF and Session Timeouts
  355. By default, Spring Security stores the CSRF token in the `HttpSession`.
  356. This can lead to a situation where the session expires, leaving no CSRF token to validate against.
  357. We have already discussed xref:features/exploits/csrf.adoc#csrf-considerations-login[general solutions] to session timeouts.
  358. This section discusses the specifics of CSRF timeouts as it pertains to the servlet support.
  359. You can change the storage of the CSRF token to be in a cookie.
  360. For details, see the <<servlet-csrf-configure-custom-repository>> section.
  361. If a token does expire, you might want to customize how it is handled by specifying a custom `AccessDeniedHandler`.
  362. The custom `AccessDeniedHandler` can process the `InvalidCsrfTokenException` any way you like.
  363. For an example of how to customize the `AccessDeniedHandler`, see the provided links for both xref:servlet/appendix/namespace/http.adoc#nsa-access-denied-handler[xml] and {gh-url}/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpServerAccessDeniedHandlerTests.java#L64[Java configuration].
  364. // FIXME: We should add a custom AccessDeniedHandler section in the reference and update the links above
  365. [[servlet-csrf-considerations-multipart]]
  366. === Multipart (file upload)
  367. We have xref:features/exploits/csrf.adoc#csrf-considerations-multipart[already discussed] how protecting multipart requests (file uploads) from CSRF attacks causes a https://en.wikipedia.org/wiki/Chicken_or_the_egg[chicken and the egg] problem.
  368. This section discusses how to implement placing the CSRF token in the <<servlet-csrf-considerations-multipart-body,body>> and <<servlet-csrf-considerations-multipart-url,url>> within a servlet application.
  369. [NOTE]
  370. ====
  371. You can find more information about using multipart forms with Spring in the https://docs.spring.io/spring/docs/5.2.x/spring-framework-reference/web.html#mvc-multipart[1.1.11. Multipart Resolver] section of the Spring reference and the https://docs.spring.io/spring/docs/5.2.x/javadoc-api/org/springframework/web/multipart/support/MultipartFilter.html[`MultipartFilter` javadoc].
  372. ====
  373. [[servlet-csrf-considerations-multipart-body]]
  374. ==== Place CSRF Token in the Body
  375. We have xref:features/exploits/csrf.adoc#csrf-considerations-multipart-body[already discussed] the tradeoffs of placing the CSRF token in the body.
  376. In this section, we discuss how to configure Spring Security to read the CSRF from the body.
  377. To read the CSRF token from the body, the `MultipartFilter` is specified before the Spring Security filter.
  378. Specifying the `MultipartFilter` before the Spring Security filter means that there is no authorization for invoking the `MultipartFilter`, which means anyone can place temporary files on your server.
  379. However, only authorized users can submit a file that is processed by your application.
  380. In general, this is the recommended approach because the temporary file upload should have a negligible impact on most servers.
  381. // FIXME: Document Spring Boot
  382. To ensure that `MultipartFilter` is specified before the Spring Security filter with XML configuration, you can ensure the `<filter-mapping>` element of the `MultipartFilter` is placed before the `springSecurityFilterChain` within the `web.xml` file:
  383. .Initializer MultipartFilter
  384. [tabs]
  385. ======
  386. Java::
  387. +
  388. [source,java,role="primary"]
  389. ----
  390. public class SecurityApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
  391. @Override
  392. protected void beforeSpringSecurityFilterChain(ServletContext servletContext) {
  393. insertFilters(servletContext, new MultipartFilter());
  394. }
  395. }
  396. ----
  397. Kotlin::
  398. +
  399. [source,kotlin,role="secondary"]
  400. ----
  401. class SecurityApplicationInitializer : AbstractSecurityWebApplicationInitializer() {
  402. override fun beforeSpringSecurityFilterChain(servletContext: ServletContext?) {
  403. insertFilters(servletContext, MultipartFilter())
  404. }
  405. }
  406. ----
  407. ======
  408. To ensure `MultipartFilter` is specified before the Spring Security filter with XML configuration, users can ensure the <filter-mapping> element of the `MultipartFilter` is placed before the springSecurityFilterChain within the web.xml as shown below:
  409. .web.xml - MultipartFilter
  410. [source,xml]
  411. ----
  412. <filter>
  413. <filter-name>MultipartFilter</filter-name>
  414. <filter-class>org.springframework.web.multipart.support.MultipartFilter</filter-class>
  415. </filter>
  416. <filter>
  417. <filter-name>springSecurityFilterChain</filter-name>
  418. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  419. </filter>
  420. <filter-mapping>
  421. <filter-name>MultipartFilter</filter-name>
  422. <url-pattern>/*</url-pattern>
  423. </filter-mapping>
  424. <filter-mapping>
  425. <filter-name>springSecurityFilterChain</filter-name>
  426. <url-pattern>/*</url-pattern>
  427. </filter-mapping>
  428. ----
  429. [[servlet-csrf-considerations-multipart-url]]
  430. ==== Include a CSRF Token in a URL
  431. If letting unauthorized users upload temporary files is not acceptable, an alternative is to place the `MultipartFilter` after the Spring Security filter and include the CSRF as a query parameter in the action attribute of the form.
  432. Since the `CsrfToken` is exposed as an `HttpServletRequest` <<servlet-csrf-include,request attribute>>, we can use that to create an `action` with the CSRF token in it.
  433. The following example does this with a JSP:
  434. .CSRF Token in Action
  435. [source,html]
  436. ----
  437. <form method="post"
  438. action="./upload?${_csrf.parameterName}=${_csrf.token}"
  439. enctype="multipart/form-data">
  440. ----
  441. [[servlet-csrf-considerations-override-method]]
  442. === HiddenHttpMethodFilter
  443. We have xref:features/exploits/csrf.adoc#csrf-considerations-multipart-body[already discussed] the trade-offs of placing the CSRF token in the body.
  444. In Spring's Servlet support, overriding the HTTP method is done by using https://docs.spring.io/spring-framework/docs/5.2.x/javadoc-api/org/springframework/web/filter/reactive/HiddenHttpMethodFilter.html[`HiddenHttpMethodFilter`].
  445. You can find more information in the https://docs.spring.io/spring/docs/5.2.x/spring-framework-reference/web.html#mvc-rest-method-conversion[HTTP Method Conversion] section of the reference documentation.