Ir al contenido

Disabled CSRF (ARCH6125)

Esta página aún no está disponible en tu idioma.

Key ruby.security.disabled-csrf · Severity warning · Category security · CWE CWE-352

Turning off CSRF protection lets state-changing requests be forged from another site. Keep CSRF token verification enabled on browser-facing endpoints.

class TransfersController < ApplicationController
skip_before_action :verify_authenticity_token
def create
Account.transfer(params[:to], params[:amount])
end
end
class TransfersController < ApplicationController
protect_from_forgery with: :exception
def create
Account.transfer(params[:to], params[:amount])
end
end

Remove skip_before_action :verify_authenticity_token and keep protect_from_forgery.