Commit graph

10 commits

Author SHA1 Message Date
Kunal Mehta
8261b1b72e Set "X-Content-Type-Options: nosniff" header in images/.htaccess
MediaWiki already sets this header unconditionally on all requests,
but images are served directly by the webserver. We want to remove the
IEContentAnalyzer, which currently provides protection against
uploading problematic files, so instead we are going to recommend
setting this header to instruct browsers to not sniff.

Per pingback data, ~83% of reporting installs use Apache.

This was suggested by Taavi.

Bug: T309787
Change-Id: I8a0c50cc0a8bc037f4c9b0a114f87793446aed7f
2023-02-24 23:59:22 -05:00
Brian Wolff
def09fd9eb Disable php in .htaccess of images directory as a hardening measure.
All our docs strongly reccomend doing this. There is even a prompt
in the installer. Not all webservers listen to this of course, but
it won't hurt things that ignore it.

The general idea is that there should be no directory that is
both writable and executable at the same time by the webserver.
images must be writable, so we should turn off php so its not executable.

Change-Id: Ic03cee12845a56a0f4f7e356493eb0f446ccf34c
2022-11-12 08:26:23 -08:00
Brian Wolff
f531634613 Remove /images .htaccess rules that are no longer relevent
The rewrite rules were removed in 164a3ac1f0. The rest of this
was just to support that. Additionally, follow sym links is not
really best practise. Sometimes this causes problems if apache
is configured with AllowOverride None (E.g. Topic:T6fd0tdieo4h8q0k)

Change-Id: Iba6c544c991f4d8aff65c4479e2f896fa290a665
2022-11-12 08:26:23 -08:00
Tim Starling
164a3ac1f0 Remove IE 6 security features from server-side code
* Deprecate WebRequest::checkUrlExtension() and have it always return
  true. This reverts the security fixes made for T30235.
* Remove IEUrlExtension. This is a helper for checkUrlExtension() which
  is not used in any extensions.
* Remove CSS sanitization code which is specific to IE6. This reverts
  the changes made to fix T57332, and related followups. I confirmed
  that the relevant test cases do not result in XSS on IE8.
* Remove related tests.

Bug: T232563
Change-Id: I7318ea4a63210252ebc64968691d4f62d79a63e9
2019-11-28 15:11:56 +11:00
wctaiwan
da6dd475f6 Change bug ID to Phabricator task ID
Change-Id: I8e1fc6ed9434a331eb7c66273305576eebed3125
2016-02-03 20:13:10 -05:00
scnd
b51645de85 images/.htaccess breaks TransformVia404 functionality
Bug: 65220
Change-Id: Ibdb91f4c676b1c77558ac806c1ccc8313ef5929f
2016-01-27 00:18:20 +00:00
kaldari
b981cf925c Add FollowSymLinks option to /images .htaccess rule
This makes sure that thumbnails load properly. Apparently
(in OSX at least), if you don't have FollowSymLinks or
SymLinksIfOwnerMatch on, loading thumbnails gives a 500
error with the existing rewrite rules in place.

Bug: 62289
Change-Id: Icc812fcf9a0b821d2ad84359e5c1d8fb8e9c78a0
2014-12-05 22:50:36 +00:00
Tim Starling
1db9197660 * Fix for bug 28534: IE 6 content type detection again
* Fix for bug 28639: user object instance cache pollution
* Release notes formatting tweak.
2011-05-05 05:29:50 +00:00
Tim Starling
7aeb423a6e (bug 28507) Fix for r85844: that revision was not actually sufficient to fix bug 28235, since URLs can have more than one question mark in them. 2011-04-14 07:10:59 +00:00
Tim Starling
3ef857fe4d Fix for bug 28235: IE6 looks for the file extension in the query string 2011-04-12 00:55:10 +00:00