Force CGI::FormBuilder->field to scalar context where necessary
authorSimon McVittie <smcv@debian.org>
Sat, 24 Dec 2016 15:03:51 +0000 (15:03 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 28 Dec 2016 21:32:12 +0000 (21:32 +0000)
commitc1120bbbe8fdea20cf64fa12247f4f4a4006c834
treef25c576e39811b35933a043496f57dfdd6c67fb6
parente193c75b7dd67cee731570c321a121cf79cb3c23
Force CGI::FormBuilder->field to scalar context where necessary

CGI::FormBuilder->field has behaviour similar to the CGI.pm misfeature
we avoided in f4ec7b0. Force it into scalar context where it is used
in an argument list.

This prevents two (relatively minor) commit metadata forgery
vulnerabilities:

* In the comments plugin, an attacker who was able to post a comment
  could give it a user-specified author and author-URL even if the wiki
  configuration did not allow for that, by crafting multiple values
  to other fields.
* In the editpage plugin, an attacker who was able to edit a page
  could potentially forge commit authorship by crafting multiple values
  for the rcsinfo field.

The remaining plugins changed in this commit appear to have been
protected by use of explicit scalar prototypes for the called functions,
but have been changed anyway to make them more obviously correct.
In particular, checkpassword() in passwordauth has a known prototype,
so an attacker cannot trick it into treating multiple values of the
name field as being the username, password and field to check for.

OVE-20161226-0001
IkiWiki/Plugin/attachment.pm
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/notifyemail.pm
IkiWiki/Plugin/passwordauth.pm
IkiWiki/Plugin/po.pm
IkiWiki/Plugin/rename.pm
debian/changelog
doc/security.mdwn