Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#6707 closed defect (bug) (fixed)

Member - Settings - Email - radio buttons

Reported by: slaFFik Owned by:
Priority: normal Milestone: 2.3.5
Component: Settings Version: 1.0
Severity: normal Keywords: has-patch
Cc:

Description

Seems, BuddyPress trusts radio-buttons values on save, which is not good.
Just change the value field of any checked radio button, and click save - in my case yes-or-no was saved successfully into DB.

In source code we have:

foreach ( (array) $_POST['notifications'] as $key => $value ) {
	bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value );
}

So any js script or user can pass any string. I believe this is a bad approach, when application doesn't control the data that is saved.

Attachments (1)

6707.01.patch (472 bytes ) - added by r-a-y 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @r-a-y
11 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review2.5
  • Version1.0

Yeah, this isn't great. This code has been in place since v1.0!

On the other hand though, the majority of plugins do direct checks for 'yes' or 'no' values only; this value is never outputted.

6707.01.patch just sets the value of the notification setting before saving it into user meta.

Filtering bp_get_user_meta( $user_id, 'notification_XXX' ) might be overkill here, so I haven't done this in 01.patch. If we feel it is necessary, then we could do it.

@r-a-y
11 years ago

#2 @boonebgorges
11 years ago

In 10329:

Improve sanitization of email notification settings.

Props boonebgorges, johnjamesjacoby, imath, dcavins.
See #6707.

#3 @boonebgorges
11 years ago

In 10330:

Improve sanitization of email notification settings.

Port of [10329] to the 2.3 branch.

Props boonebgorges, johnjamesjacoby, imath, dcavins.
See #6707.

#4 @boonebgorges
11 years ago

In 10332:

Improve sanitization of email notification settings.

Port of [10329] to the 2.2 branch.

Props boonebgorges, johnjamesjacoby, imath, dcavins.
See #6707.

#5 @boonebgorges
11 years ago

In 10334:

Improve sanitization of email notification settings.

Port of [10329] to the 2.1 branch.

Props boonebgorges, johnjamesjacoby, imath, dcavins.
See #6707.

#6 @boonebgorges
11 years ago

In 10336:

Improve sanitization of email notification settings.

Port of [10329] to the 2.0 branch.

Props boonebgorges, johnjamesjacoby, imath, dcavins.
See #6707.

#7 @boonebgorges
11 years ago

  • Milestone 2.52.3.5
  • Resolutionfixed
  • Status newclosed
Note: See TracTickets for help on using tickets.