Hacker News new | ask | show | jobs
by rafram 656 days ago
Clickjacking has been a solved problem for over a decade. Set X-Frame-Options: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-...
4 comments

Hence the need for a hosting service that you trust. You can't force that header on an untrusted server.
How do I set this in a shared hosting environment like GoDaddy?
You can set a CSP in the HTML head section using a meta http-equiv tag. It has similar functionality to X-frame-options IIRC.
Alas, no. ‘frame-ancestors’ does not work in meta. There is no reliable way to prevent click jacking if you are just editing the HTML. That makes sense: in order for these meta directives to even be enacted the HTML will have already begun to download and be parsed.

The old school way is comparing the top level URL with JS and redirecting but there are ways to deal with that

is it not by default? If no, then i would consider it as a bad design.
or even better CSP options no?