Skip to content

Commit f993710

Browse files
committed
Make Content-Security-Policy disallow 'object-src' by default
Closes #190
1 parent ff080bb commit f993710

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

h5bp/security/content-security-policy.conf

+12-5
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@
4141
# The `frame-ancestors` directive helps avoid "Clickjacking" attacks and
4242
# is similar to the `X-Frame-Options` header.
4343
#
44-
# Browsers that support the CSP header will ignore `X-Frame-Options` if
44+
# Browsers that support the CSP header should ignore `X-Frame-Options` if
4545
# `frame-ancestors` is also specified.
4646
#
47-
# (5) Forces the browser to treat all the resources that are served over HTTP
47+
# (5) Elements controlled by `object-src` are perhaps coincidentally
48+
# considered legacy HTML elements and are not receiving new standardized
49+
# features (such as the security attributes `sandbox` or `allow` for
50+
# `<iframe>`).
51+
# Therefore it is recommended to restrict this fetch-directive (e.g.,
52+
# explicitly set `object-src 'none'` if possible).
53+
#
54+
# (6) Forces the browser to treat all the resources that are served over HTTP
4855
# as if they were loaded securely over HTTPS by setting the
4956
# `upgrade-insecure-requests` directive.
5057
#
@@ -53,7 +60,7 @@
5360
# loaded over HTTPS you must include the `Strict-Transport-Security`
5461
# header.
5562
#
56-
# (6) The `Content-Security-Policy` header is included in all responses
63+
# (7) The `Content-Security-Policy` header is included in all responses
5764
# that are able to execute scripting. This includes the commonly used
5865
# file types: HTML, XML and PDF documents. Although Javascript files
5966
# can not execute script in a "browsing context", they are still included
@@ -75,6 +82,6 @@
7582
# https://content-security-policy.com/
7683

7784
<IfModule mod_headers.c>
78-
# (1) (2) (3) (4) (5) (6)
79-
Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
85+
# (1) (2) (3) (4) (5) (6) (7)
86+
Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; object-src 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
8087
</IfModule>

0 commit comments

Comments
 (0)