MoinMoin and Authentication

Currently you have two options with moin & logins:

IF we think about the origin and purpose of a wiki, this might seem enough, but for a closed, secured wiki, this has too much shortcomings.

Cornerpoints for a HTTP Auth inside Moin

Another thing would prove very useful for many people: accessing custom databases for user storage:

Security considerations

General Flow of Auth

The following 'flowchart' describes how the authentication process in moin should work:

authflow.tdraw

Notes:

What needs to be done?

Tuneability

/!\ this is just a brainstorm for what could be configureable

newauth_enabled
enables new authentication with moin doing HTTP Auth. Automatically disables the use of the MOIN_ID cookie and login action with uid only for security reasons.
newauth_authtype

use Basic or Digest auth

  • is digest widely enough supported meanwhile?
    • don't know, but it's just an option
newauth_duplicate_sessions

allow duplicate sessions with the same WikiName

newauth_ignore_ip
don't check session IP (roaming sessions)
newauth_sessiondb_file
where to save sessions (for cgi or restarted long runs)
  • just use caching module or data/cache/ location, no config needed
    • true
newauth_sessiondb_type
pickle or dbhash?
  • pickle!?
    • bsddb/dbhash is faster in access
newauth_session_timeout
maximum time between requests
  • maybe use some fixed value making sense
    • yeah, this option will have a default value, but it should be configureable
newauth_cookie_lifetime
how long is the cookie saved? (default browserlife, should be less than session_timeout)
  • we have already some cookie lifetime setting, can that be reused?
    • this replaces the old one
newauth_validator
set the validator class to use (to hook up external auth sources)
  • ??
    • to hook up external auth sources... LDAP, etc...

Useful Options for classic auth:

auth_automap

automatically store a mapping to REMOTE_USER when creating a new login (mapping a non wiki external auth name to the WikiName just created).

Q & A

Integration in moin--main--1.3

TLA Branch

ograf@bitart.de--2004-local/moin--newauth--1.3

Live Examples
none

TODO: (./) marks finished steps

Discussion

Need for client-side hashing

A major shortcoming, I think, is that Moin currently lacks client side hashing of passwords. This is a disservice not to the installers of Moin, but to the non-technical users of Moin wikis who frequently reuse the same passwords for many applications. Ethernet sniffers can easily pick the password out of an office LAN and thus a stock installation of Moin can be detremental for the security of many applications and the user.

An obvious answer is just switch to SSL connections. But if this is the answer, it should become part of the default installation procedure and there should be big yellow warning signs warning of the potential problem when not using SSL. However, the same problem exists as the web site has access to the raw user password. From the user's point of view, it is better to have client side hashing and never have any web site have access to a raw password.

There is a Javascript procedure for SHA-1 encryption at http://pajhome.org.uk/crypt/md5. A way to implementing this is to store a hashed password formed by the cancatenation of

Using all three strings together results in unique hashes for the same password and the same user ID across multiple applications. Thus, capturing a hashed user password will be of no value in attacking other applications used by that user.

using the above, a page with a login form would include hidden fields consisting of the application consistent salt and some unique number such as a modified timestamp. When the form submit button is clicked, the client hashes ID, password, and salt to create the hashed password, and then hashes the result with the unique number. The resulting hash is passed by overwriting the password field.

The server side must remember the unique number by associating it with a temporary session cookie. When the incoming login form arrives, it uses the login ID to retrieve the stored hashed password and then hashes the stored password against the unique number associated with the session cookie. The resulting hash is compared against the incoming password. If it matches, a session cookie is created.

The weak point (where an SSL connection would be useful) is the change password transaction. Here the new hashed password must be transmitted without modification. Capturing the new hashed password could be useful to an attacker, but the opportunity does not come often and the result is useful only for an attack on the target site.

Roger Haase

Separation of Login from UserPreferences

A starting point is that I dislike HTTP Authentication. It is ugly, and confusing to novice users because the login messagebox is not obviously and elegantly connected to the design of the web site.

What I would like to see in this design, but do not see or understand, is a separation of login from user preferences. I think I want a UserLogin page that would contain a UserLogin macro where the login macro returns the html form part of the rendered page. The UserLogin page would be accessed by clicking a Login button or attempting to access a protected page.

Clicking the form submit button would normally reexecute the UserLogin page and the UserLogin macro would discover and process the incoming ID and password fields, validate the user, and if valid: establish the session cookie, and redirect the user's browser to the FrontPage or prior protected page (A potential hard part is macros seem to get control too late to issues a 302). Should user validation fail, the UserLogin macro regenerates the login form. The default UserLogin macro should allow new registrations by filling in an email address and clicking a new registration button.

The session cookie value would look similar to the current moin-ID and would be freshly generated for each new validated session. A server-side dictionary would connect the session-ID to a user name and perhaps an IP-address or browser name to be used for additional validation on every incoming request.

The UserPreference macro would be simplified to show and change only user preferences.

For those who dislike HTTP Authentication, the above provides new opportunities for easy customization and would enable sites to provide even more security by disallowing self-registration and validating logins from an external database.

Modularization and separation of authentication and authorization

There should be a pluggable architecture for both authentication and authorization, but they must be separate. This way you can authenticate with HTTP Basic auth, GSS, Cookie or Session (login form with username and password) while authorization can be done either using the traditional "Moin way" of defining groups and ACL's or perhaps a totally different type of authorization backend. It's important not to treat authentication as "login", because there are many instances of authentication where you do not use logins at all (kerberos ticket forwarding, etc). Authentication should only tell the system "I really am this user", but what the user may do with the system is for the authorization API to take care of.

The important things to remember are:

Making the authentication API separate and pluggable would be a good first step.

MoinMoin: OliverGraf/HttpAuthentication (last edited 2007-10-29 19:09:20 by localhost)