Of course it's whack a mole. Moat things in infosec are, that doesn't mean browsers shouldn't ship with secure defaults or present trustworthy info in the address bar.
Agreed CSP would be a good place to fix.
Agreed CSP would be a good place to fix.
Why not? What's stopping browser from disabling window.opener unless CSP specifically allows it?
(totally appreciate there may be something I'm missing here, and thanks for responding)
window-ref 'self' PayPal.com
Something like that would let the site reference their own windows as well as grant access to a "trusted partner" like PayPal.
A maintained site that relies on window.opener should, after a 24 month period of angry console warnings saying a change needs to be made, actually make that change.