Fix CsrfProtectionMiddleware perf degradations (#67488)