Aller au contenu

Open redirect (ARCH6122)

Ce contenu n’est pas encore disponible dans votre langue.

Key ruby.security.open-redirect · Severity warning · Category security · CWE CWE-601

Taking a redirect target from untrusted input without validation lets attackers phish users by redirecting them to malicious sites through a trusted domain.

def login
redirect_to params[:return_to]
end
def login
redirect_to params[:return_to], allow_other_host: false
end

Redirect only to relative paths or origins on an allowlist; do not permit external targets.