NShiftKey-Rule-Guide logo NShiftKey-Rule-Guide

1. Vulnerability Description

X-Frame-Options

Option Function
DENY Cannot contain the page at any site
SAMEORIGIN Can only contain pages in the same domain
Allow-From The page can only be included in a defined domain. Different browsers have different support

HTTP Strict-Transport-Security(HSTS)

Option Function
Max-age The header will operate at that time. (unit : seconds)
includeSubdomain Determine if subdomain is included (optional setting)

Content-Security-Policy

X-Content-Type-Options

Cashe control

2. How to check vulnerability

3. Vulnerability Countermeasure

X-Frame-Options

Spring setting

<http>
    <headers>
        <frame-options policy="SAMEORIGIN" />
    </headers>
</http>

Apache

/* Allow only if same origin */
Header always set X-Frame-Options SAMEORIGIN
/* Deny Show All */
Header set X-Frame-Options DENY
/* Allow only for specified origin */
Header set X-Frame-Options "ALLOW-FROM https://example.com/"

Nginx

add_header X-Frame-Options SAMEORIGIN;
add_header X-Frame-Options DENY;

HTTP Strict-Transport-Security(HSTS)

Spring setting

<http>
    <headers>
        <hsts include-subdomains="true" max-age-seconds="31536000" />
    </headers>
</http>

Apache

Header always set Strict-Transport-Security "max-age=15552000; preload"

Nginx

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;