Skip to content

Commit edd912d

Browse files
mathiasbynensalrra
authored andcommitted
Disable MIME sniffing by default
The lack of `X-Content-Type-Options "nosniff"` header can lead to cross-origin data leaks. For more in-depth information on how this can be done, please see @hasegawayosuke's slides from OWSP AppSec APAC 2014: http://www.slideshare.net/hasegawayosuke/owasp-hasegawa.
1 parent 8d6141b commit edd912d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.htaccess

+9-7
Original file line numberDiff line numberDiff line change
@@ -378,22 +378,24 @@ AddDefaultCharset utf-8
378378
</FilesMatch>
379379

380380
# ------------------------------------------------------------------------------
381-
# | Reducing MIME-type security risks |
381+
# | Reducing MIME type security risks |
382382
# ------------------------------------------------------------------------------
383383

384384
# Prevent some browsers from MIME-sniffing the response.
385385

386-
# This reduces exposure to drive-by download attacks and should be enable
387-
# especially if the web server is serving user uploaded content, content
388-
# that could potentially be treated by the browser as executable.
386+
# This reduces exposure to drive-by download attacks and cross-origin data
387+
# leaks, and should be left uncommented, especially if the web server is
388+
# serving user-uploaded content or content that could potentially be treated
389+
# as executable by the browser.
389390

391+
# http://www.slideshare.net/hasegawayosuke/owasp-hasegawa
390392
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
391393
# http://msdn.microsoft.com/en-us/library/ie/gg622941.aspx
392394
# http://mimesniff.spec.whatwg.org/
393395

394-
# <IfModule mod_headers.c>
395-
# Header set X-Content-Type-Options "nosniff"
396-
# </IfModule>
396+
<IfModule mod_headers.c>
397+
Header set X-Content-Type-Options "nosniff"
398+
</IfModule>
397399

398400
# ------------------------------------------------------------------------------
399401
# | Reflected Cross-Site Scripting (XSS) attacks |

0 commit comments

Comments
 (0)