Replacing X-Frame-Options with CSP
Asked Answered
G

1

9

I am migrating from X-Frame-Options to Content Security Policy to fix the click-jacking vulnerability. My application used to set the SAMEORIGIN policy in hte X-Frame-Options header. What is the equivalent option in Content-Security-Policy?

Grapeshot answered 27/3, 2017 at 6:55 Comment(0)
C
14

frame-ancestors

  • X-Frame-Options: SAMEORIGINContent-Security-Policy: frame-ancestors 'self'

  • X-Frame-Options: DENYContent-Security-Policy: frame-ancestors 'none'

See also https://w3c.github.io/webappsec-csp/#frame-ancestors-and-frame-options

Carreon answered 27/3, 2017 at 7:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.