Missing rel=noopener noreferrer in target=_blank links (Phishing attack)
Links with target=_blank lacked rel=noopener noreferrer, allowing the opened page to change the opener's location via window.opener. An attacker could redirect the original page to a phishing site.
- Fixed in 3 days
- Paid in 6 months
- Disclosed after 3 days
Links that use target=_blank need to have rel="noopener noreferrer" in order to mitigate phishing attack (opened page can change the location of page that opened him via window.opener.location = 'http://phishingsite.com/' )
more information about this vulnerability: https://blog.whatever.io/2015/03/07/on-the-security-implications-of-window-opener-location-replace/ https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
steps to reproduce:
1. click on any of the links below from airship. 2. run the following javascript code in new opened page:
window.opener.location = 'http://phishingsite.com/'
The above will work even if the target domain is changed (not github.com anymore) via clicking on link from target domain.
usage of _blank in airship:
1. https://github.com/paragonie/airship/blob/master/src/Installer/skins/admin_account.twig#L17
get a password manager such as <a target="_blank" href="https://github.com/keepassx/keepassx/">KeePassX</a>.
html = 'Good password, as long as it\'s unique!<br />If you\'re not already, consider using a password manager such as <a target="_blank" href="https://github.com/keepassx/keepassx/">KeePassX</a>.';
html = 'Good password, as long as it\'s unique!<br />If you\'re not already, consider using a password manager such as <a target="_blank" href="https://github.com/keepassx/keepassx/">KeePassX</a>.';
set_attributes: {
target: "_blank",
rel: "nofollow"
},
fix:
- always add rel="noopener noreferrer" for links that have target=_blank, unless the opened window need to change the location using window.opener.location
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the links were created without the rel=noopener noreferrer attribute, leaving window.opener accessible.
Impact
An attacker could redirect the original page to a phishing site.
What the attacker needed
Victim clicks a link with target=_blank; attacker controls the opened page
The fix
Always add rel="noopener noreferrer" for links that have target=_blank, unless the opened window needs to change the location using window.opener.location.
How it was found
- Click on any of the links below from airship.
- Run the following javascript code in new opened page: window.opener.location = 'http://phishingsite.com/'
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a link opens in a new tab, the new page can sometimes control the original page using a browser feature called window.opener. If the new page is malicious, it can redirect the original page to a fake login site. Adding rel=noopener noreferrer stops this.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.