Manual:$wgMimeTypeBlacklist/es

From Linux Web Expert

<translate> MIME types</translate>: $wgMimeTypeBlacklist
Tipos MIME que rechazar cuando está activado $wgVerifyMimeType .
<translate> Introduced in version:</translate>1.5.0
<translate> Removed in version:</translate>1.37.0 (Gerrit change 680806; git #4dae3b1a)
<translate> Allowed values:</translate>(array of MIME types (strings))
<translate> Default value:</translate>(véase más abajo)

Detalles

Files with these MIME types will never be allowed as uploads if $wgVerifyMimeType is enabled.

Valor predeterminado

  • 'application/x-opc+zip', 'application/msword', 'application/vnd.ms-powerpoint', 'application/vnd.msexcel' were added after 1.17.0 (r81376), and removed in r82783
  • 'application/x-opc+zip', 'text/scriptlet', 'application/x-msdownload' were introduced after 1.5.5
  • 'application/x-msmetafile' was added in 1.5.5
  • 'application/zip' was added in 1.14 and then removed in 1.18
  • All other values were available since the setting was introduced in 1.5.0

1.35.12 (gerrit:961936, phab:T341565):

$wgMimeTypeBlacklist = [
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html',
	# Similarly with JavaScript itself
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
	# XML files generally - T341565
	'application/xml', 'text/xml',
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.36</tvar> is unsupported version</translate>">
1.35 – 1.36
<translate> MediaWiki versions:</translate>
$wgMimeTypeBlacklist = [
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html',
	# Similarly with JavaScript itself
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.34</tvar> is unsupported version</translate>">
1.18 – 1.34
<translate> MediaWiki versions:</translate>
$wgMimeTypeBlacklist = [
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.17</tvar> is unsupported version</translate>">
1.17
Versión de MediaWiki:
$wgMimeTypeBlacklist = array(
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html', 'text/javascript', 'text/x-javascript',  'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
	# A ZIP file may be a valid Java archive containing an applet which exploits the
	# same-origin policy to steal cookies
	'application/zip',

	# MS Office OpenXML and other Open Package Conventions files are zip files
	# and thus blacklisted just as other zip files. If you remove these entries
	# from the blacklist in your local configuration, a malicious file upload
	# will be able to compromise the wiki's user accounts, and the user 
	# accounts of any other website in the same cookie domain.
	'application/x-opc+zip',
	'application/msword',
	'application/vnd.ms-powerpoint',
	'application/vnd.msexcel',
);
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.16</tvar> is unsupported version</translate>">
1.14 – 1.16
<translate> MediaWiki versions:</translate>
$wgMimeTypeBlacklist= array(
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html', 'text/javascript', 'text/x-javascript',  'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile',
	# A ZIP file may be a valid Java archive containing an applet which exploits the
	# same-origin policy to steal cookies
	'application/zip',
);
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.13</tvar> is unsupported version</translate>">
1.12 – 1.13
<translate> MediaWiki versions:</translate>
$wgMimeTypeBlacklist= array(
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html', 'text/javascript', 'text/x-javascript',  'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Client-side hazards on Internet Explorer
	'text/scriptlet', 'application/x-msdownload',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile'
);
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.11</tvar> is unsupported version</translate>">
1.5 – 1.11
<translate> MediaWiki versions:</translate>
$wgMimeTypeBlacklist= array(
	# HTML may contain cookie-stealing JavaScript and web bugs
	'text/html', 'text/javascript', 'text/x-javascript',  'application/x-shellscript',
	# PHP scripts may execute arbitrary code on the server
	'application/x-php', 'text/x-php',
	# Other types that may be interpreted by some servers
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Windows metafile, client-side vulnerability on some systems
	'application/x-msmetafile'
);

Example

If you wanted to allow html files to be uploaded:

$wgFileExtensions[] = 'html';
$wgFileBlacklist = array_diff( $wgFileBlacklist, array ('html') );
$wgMimeTypeBlacklist = array_diff( $wgMimeTypeBlacklist, array ('text/html') );