X-Frame-Options (contre le click-jacking, RFC 7034, 2013-10)

../../../_images/x_frame_options.png

Définition Mozilla

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe> or <object> .

Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

Solution Django

MIDDLEWARE = [
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

This defaults to SAMEORIGIN.

To set DENY:

X_FRAME_OPTIONS = 'DENY'