1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-01 15:18:20 +00:00

updated cookie token size

This commit is contained in:
Kevin Joiner
2022-06-09 11:34:57 -04:00
parent 82478fb169
commit bbb7a54593

View File

@@ -52,7 +52,8 @@ func CheckCSRF(apiContext *types.APIContext) error {
cookie, err := apiContext.Request.Cookie(csrfCookie)
if err == http.ErrNoCookie {
bytes := make([]byte, 5)
// 16 bytes = 32 Hex Char = 128 bit entropy
bytes := make([]byte, 16)
_, err := rand.Read(bytes)
if err != nil {
return httperror.WrapAPIError(err, httperror.ServerError, "Failed in CSRF processing")