Ticket #381 (new defect)

Opened 4 months ago

Last modified 4 months ago

CSRF on Account Settings page

Reported by: tsewen Assigned to: nobody
Priority: highest Milestone: 0.9.2
Component: core Version: 0.9.1
Severity: critical Keywords: csrf
Cc: Patch Included: 1
Review Stage: reviewed

Description

There is a Cross Site Request Forgery vulnerability in the account setting page. This vulnerability can be used to take over a user's account! I found this in Elgg 0.9.2, but there's no option below to make the version 0.9.2. Please let me know if I should submit more details on how this can be done.

The patch uses elggform_key_get and elggform_key_check to prevent CSRF, functions that seem to have been designed to prevent CSRF in the first place. The patch essentially uses elggform_key_get to generate a key, which is inserted into a hidden input field in the form and also into the user's session. Then elggform_key_check is used to check the submitted key against the key in the session variable.

Note that this patch has not completely patched the user details page. It just protects against the most serious parts, like CSRF against passwords and e-mail. The problem is that the various php files in $functionuserdetails:init? array handles processing of options the plugins individually insert into user details page. There are two options I can think of:

  1. Make every plugin writer check for the form_key or
  2. Have a place where the form_key is checked before any plugin is called to process the input from user details page.

The second option sounds better, but I do not know how to do the later yet.

Attachments

userdetails.diff (1.2 kB) - added by tsewen on 07/24/08 23:15:34.

Change History

07/24/08 23:15:34 changed by tsewen

  • attachment userdetails.diff added.

07/24/08 23:17:39 changed by tsewen

  • keywords set to csrf.

(in reply to: ↑ description ) 07/24/08 23:20:22 changed by tsewen

Oops, I meant to mention the $function[userdetails:init] array.

08/06/08 07:40:00 changed by misja

  • review_stage changed from unreviewed to reviewed.

Patch applied in r1611, leaving this ticket open to allow further discussion.