Jump to content

Kézikönyv:$wgMimeTypeBlacklist

From mediawiki.org
This page is a translated version of the page Manual:$wgMimeTypeBlacklist and the translation is 100% complete.
MIME types: $wgMimeTypeBlacklist
A $wgVerifyMimeType engedélyezése esetén tiltott MIME-típusok.
Bevezetve:1.5.0
Eltávolítva:1.37.0 (Gerrit change 680806; git #4dae3b1a)
Megengedett értékek:(MIME-típusok tömbje (sztringek))
Alapértelmezett érték:(lásd alább)

Részletek

A $wgVerifyMimeType engedélyezése esetén az itt megadott MIME-típusok nem tölthetőek fel.

Alapértelmezett érték

  • Az * 'application/x-opc+zip', 'application/msword', 'application/vnd.ms-powerpoint', 'application/vnd.msexcel' az 1.17.0 (r81376) változtatással lettek feketelistásak, a r82783 változtatással pedig töröltük ezeket.
  • 'application/x-opc+zip', 'text/scriptlet', 'application/x-msdownload' – Az 1.5.5 után bevezetve
  • 'application/x-msmetafile' – az 1.5.5-ben hozzáadva
  • 'application/zip' – A 1.14 változatással hozzáadva, a 1.18 verzióban törölve
  • Mindne más érték az 1.5.0 verzióban lett bevezetve.

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',
];
MediaWiki-verziók:
1.35 – 1.36
$wgMimeTypeBlacklist = [
	# A HTML sütielfogó JavaScriptet és webes bugokat tartalmazhat
	'text/html',
	# Hasonlóan a JavaScripthez
	'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
	# A PHP-szkriptek káros kódokat futtathatnak a szerveren
	'application/x-php', 'text/x-php',
	# Egyéb típusok, melyeket egyes szerverek futtathatnak
	'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
	# Kliensoldali kockázatok Internet Explorer esetén.
	'text/scriptlet', 'application/x-msdownload',
	# Windows-metafájl, kliensoldali sebezhetőség más rendszereken
	'application/x-msmetafile',
];
MediaWiki-verziók:
1.18 – 1.34
$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',
];
MediaWiki-verzió:
1.17
$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',
);
MediaWiki-verziók:
1.14 – 1.16
$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',
);
MediaWiki-verziók:
1.12 – 1.13
$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'
);
MediaWiki-verziók:
1.5 – 1.11
$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') );