Security issues with authorization extensions
MediaWiki is not designed to be a CMS, or to protect sensitive data. To the contrary, it was designed to be as open as possible. Thus it does not inherently support full featured, air-tight protection of private content. But with the massive increase of MediaWiki use in corporate intranets and the many CMS-like features emerging, demand for tighter security is emerging.
To help authors of security extensions, this list of the security flaws found in the field is being maintained, so that they can test their extension against each. There are several extensions that claim to give selective read/write access to pages in Category:Page specific user rights extensions, and currently most of these do exhibit several of the listed flaws.
Testing security extensions [edit]
If you are going to implement read or write access, check the extension for the flaws listed in the table below by logging in as a user without read/write permissions. It can be very annoying logging in and out between a sysop to change the code, and then as a user without any access rights to test it, so a good idea is to run two different browsers like Firefox and Internet Explorer which each store their own set of cookies. This way you can be logged in as sysop in your usual browser, and be logged in as a "nobody" on your second browser at the same time.
Table of common security extension limitations [edit]
Function/Test | Check for | Comment |
---|---|---|
Inclusion/transclusion |
|
This is partially addressed by the $wgNonincludableNamespaces setting introduced in MW 1.10, rev:19934, or by installing the NonincludableNamespaces extension in earlier versions. |
Preloading |
|
Should be safe with extension using the UserCan hook, at least since 1.12 (maybe also earlier). |
XML export (Special:Export) |
|
For extensions using the userCan hook, this has been fixed in MW 1.10, rev:19935. Before that, access to Special:Export has to be disabled. |
Atom/RSS feeds |
|
For extensions using the userCan hook, this has been fixed in |
Listings & search |
|
For extensions using the userCan hook, this has been partially addressed in MW 1.10, rev:21821: The search page no longer shows excerpts from pages that are not readable - but it still lists the titles of articles which are not accessable to the user. This problem can be eliminated by using Extension:RemoveProtectedContent as well. For earlier versions of MediaWiki, searching must not be allowed for users that should not be able to read all pages. LuceneSearch and Extension:MWSearch create a public server that does not need any authentication (but you can easily create a command line interface to replace wgets, though needs patches) |
Diff & revision links |
|
For extensions using the userCan hook, this should be OK on recent versions of MediaWiki. |
API |
|
Unknown |
Action links |
|
For extensions using the userCan hook, this should be OK on recent versions of MediaWiki. |
Related rights |
|
If using userCan, this should be OK, but might need to write ArticleInsertComplete hook for creations and TitleMoveComplete hook for moves that call userCan to 'copy' permissions. |
Author backdoor |
|
|
Caching |
|
Limiting article caching to anonymous users might provide most of the performance benefits for sites with mostly anonymous users (like Wikipedia), without compromising security. |
Files & Images |
|
Since uploaded files are normally served directly by the web server, not through MediaWiki, it's not easily possible for extensions to prevent access. See Manual:Image Authorisation for instructions on setting up access restrictions for images. (img_auth.php uses userCan since r52751). |
Redirects |
|
|
Edit Section |
|
If the security relies on tags embedded in the page code then these tags will not necessarily be present in the text you are editing, even if they are present elsewhere on the page. |
Watching Pages |
|
Needs a WatchArticle hook that will call userCan. |
Other extensions |
|
There are probably more "holes" in the read protection system. So, denying read access should be seen as a "nothing to see here, move along," sort of thing rather than a guarantee of secrecy.
Language: | English • 日本語 |
---|