Last modified: 2014-08-28 14:25:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71596, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69596 - Provide JavaScript login widget
Provide JavaScript login widget
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.24rc
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 70122
  Show dependency treegraph
 
Reported: 2014-08-15 10:12 UTC by Niklas Laxström
Modified: 2014-08-28 14:25 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niklas Laxström 2014-08-15 10:12:23 UTC
I need a login widget I can show the user to login without leaving the current page. This kind of widget can be used in many places, for example in Special:Translate to recover from expired session or log in on other pages to be able to make changes.

Because there might be captchas, rate limiting etc. I think that such widget should exist in MediaWiki core.
Comment 1 Michael M. 2014-08-16 08:53:56 UTC
A login widget could be easily spoofed by a malicious user script (while Special:Login is difficult to spoof). Bug 48931 was closed as WONTFIX for the possibility that an evil script could replace the links in Special:Preferences to change the password, which seems a more difficult attack to me than simulating a login widget and sending the entered password to a server under the attacker's control.
Comment 2 Rainer Rillke @commons.wikimedia 2014-08-17 15:05:04 UTC
(In reply to Michael M. from comment #1)
naak naak naak, again such a security nonsense; the same as in Bug 48931 -- either we trust user scripts and this is what we currently do (see below) or we don't and they must be completely removed.

1) Do you store passwords in your browser for Commons? Firefox? Please log out and go to https://commons.wikimedia.org/w/index.php?title=Help:Gadget-Cat-a-lot&withJS=MediaWiki:ActivateGadget.js&gadgetname=Cat-a-lot -- see your password will be pre-filled and my evil script could read it. Scary, isn't it :~)

2) Malicious scripts could, at any time create a fake login form like "We are sorry, but your session expired. Please log in again ... blah blah Password: [_______]". We are not actively telling users that they should only use [[Special:UserLogin]] for security reasons and never enter their password on a different page.

3) There is an API module for login and it's not only useful to bots. The security claims are void, let's move forward.
Comment 3 Michael M. 2014-08-21 08:15:50 UTC
(In reply to Rainer Rillke @commons.wikimedia from comment #2)
> (In reply to Michael M. from comment #1)
> 1) Do you store passwords in your browser for Commons? Firefox? Please log
> out and go to
> https://commons.wikimedia.org/w/index.php?title=Help:Gadget-Cat-a-
> lot&withJS=MediaWiki:ActivateGadget.js&gadgetname=Cat-a-lot -- see your
> password will be pre-filled and my evil script could read it. Scary, isn't
> it :~)

Even if I allow Firefox to store my password for Commons (which normally I don't do) only my user name is prefilled, not the password.
Comment 4 Matthew Flaschen 2014-08-23 21:42:09 UTC
(In reply to Michael M. from comment #1)
> A login widget could be easily spoofed by a malicious user script (while
> Special:Login is difficult to spoof).

There's actually nothing that makes Special:UserLogin particularly difficult to spoof.  Using malicious JavaScript, you can even spoof the actual URL using history.replaceState (https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history), so that when someone clicks a pre-determined link (or visits a particular wiki page), their browser URL bar will show the exact URL of the normal login page, and the web page can look like the login page.

The solution is to keep a careful eye on all scripts in the MediaWiki namespace, and be cautious when installing user scripts.

If we do add such a "login and stay on the page" feature (which is under discussion, e.g. as part of a potential "login and save your edit" combination workflow), we will also have to communicate it to avoid confusion.

However, security concerns should not simply block all discussion and development of features in this area.
Comment 5 contrafibularity 2014-08-26 07:32:19 UTC
+1! 

With the additional service that without having to leave the page, you can check if you're still logged in and if not, log in again. I'm not sure if this would also put an end to the problem of expired session data, but it's a step in the right direction. 

Evidently this would need to be an option available to site owners, to be enabled in Localsettings.php (for all editors) and perhaps Special:Preferences. If you don't trust this feature to be available on your site, then don't opt in for it.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links