Příručka:$wgMimeTypeBlacklist
Appearance
Tato funkce byla odstraněna z jádra MediaWiki ve verzi 1.37.0. Jaká existují jiná alternativní řešení této funkcionality, zjistíte na stránce $wgMimeTypeExclusions. |
MIME typy: $wgMimeTypeBlacklist | |
---|---|
Typy MIME, které se mají zakázat, pokud je povolena funkce $wgVerifyMimeType . |
|
Zavedeno od verze: | 1.5.0 |
Odstraněno od verze: | 1.37.0 (Gerrit change 680806; git #4dae3b1a) |
Povolené hodnoty: | (pole typů MIME (řetězce)) |
Výchozí hodnota: | (viz níže) |
Další nastavení: Podle abecedy | Podle funkce |
Podrobnosti
Soubory s těmito typy MIME nebudou nikdy povoleny k nahrávání, pokud je povolena funkce $wgVerifyMimeType .
Výchozí hodnoty
- 'application/x-opc+zip', 'application/msword', 'application/vnd.ms-powerpoint', 'application/vnd.msexcel' byly po verzi 1.17.0 (r81376) na černé listině a odstraněny v r82783
- 'application/x-opc+zip', 'text/scriptlet', 'application/x-msdownload' byly zavedeny po 1.5.5
- 'application/x-msmetafile' byl přidán v 1.5.5
- 'application/zip' byl přidán v 1.14 a poté odstraněn v 1.18
- Všechny ostatní hodnoty byly dostupné od zavedení tohoto nastavení ve verzi 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',
];
Verze MediaWiki: | 1.35 – 1.36 |
$wgMimeTypeBlacklist = [
# HTML může obsahovat JavaScript kradoucí soubory cookie a webové chyby
'text/html',
# Podobně se samotným JavaScriptem
'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
# PHP skripty mohou na serveru spouštět libovolný kód
'application/x-php', 'text/x-php',
# Jiné typy, které mohou být interpretovány některými servery
'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
# Nebezpečí na straně klienta v aplikaci Internet Explorer
'text/scriptlet', 'application/x-msdownload',
# Metasoubor Windows, zranitelnost na straně klienta na některých systémech
'application/x-msmetafile',
];
Verze MediaWiki: | 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',
];
Verze MediaWiki: | 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',
);
Verze MediaWiki: | 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',
);
Verze MediaWiki: | 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'
);
Verze MediaWiki: | 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') );