ikiwiki/IkiWiki
Simon McVittie f357856448 passwordauth: prevent authentication bypass via multiple name parameters
Calling CGI::FormBuilder::field with a name argument in list context
returns zero or more user-specified values of the named field, even
if that field was not declared as supporting multiple values.
Passing the result of field as a function parameter counts as list
context. This is the same bad behaviour that is now discouraged
for CGI::param.

In this case we pass the multiple values to CGI::Session::param.
That accessor has six possible calling conventions, of which four are
documented. If an attacker passes (2*n + 1) values for the 'name'
field, for example name=a&name=b&name=c, we end up in one of the
undocumented calling conventions for param:

    # equivalent to: (name => 'a', b => 'c')
    $session->param('name', 'a', 'b', 'c')

and the 'b' session parameter is unexpectedly set to an
attacker-specified value.

In particular, if an attacker "bob" specifies
name=bob&name=name&name=alice, then authentication is carried out
for "bob" but the CGI::Session ends up containing {name => 'alice'},
an authentication bypass vulnerability.

This vulnerability is tracked as OVE-20170111-0001.

(cherry picked from commit e909eb93f4530a175d622360a8433e833ecf0254)
2017-01-11 18:11:06 +00:00
..
Plugin passwordauth: prevent authentication bypass via multiple name parameters 2017-01-11 18:11:06 +00:00
Setup Silence "used only once: possible typo" warnings for variables that are part of modules' APIs 2016-01-19 11:24:18 +00:00
CGI.pm cgitemplate: actually remove dead code 2016-12-19 13:20:55 +00:00
Receive.pm Wrapper: allocate new environment dynamically 2016-05-11 09:18:14 +01:00
Render.pm improve warning message for multiple sources for page 2016-05-31 15:29:09 -04:00
Setup.pm Detect plugins with a broken getsetup and warn. 2013-03-04 13:19:05 -04:00
UserInfo.pm remove deprecated admin prefs 2008-12-24 16:16:03 -05:00
Wrapper.pm Enquote $background_command as surely intended. 2017-01-02 06:57:35 -05:00