link_to
has _blank
, but no rel: 'noopener'
RB-RL1033Calls to link_to
that contain a target: '_blank'
but no rel: 'noopener'
can be a security risk, as the loaded page will have control over the previous page and could change its location for phishing purposes.
The option rel: 'noreferrer'
also blocks this behavior and removes the http-referrer
header.
link_to 'Click here', url, target: '_blank'
link_to 'Click here', url, target: '_blank', rel: 'noopener'
link_to 'Click here', url, target: '_blank', rel: 'noreferrer'