When you have a public profile field, and make it hidden, the field values are still in the 'profile_values' table.
And they'll stay there because profile_save() doesn't handle them anymore.

What's worse is that a they might also be browsable, if a page title has been given.
This is because the function profile_browse() checks for 'private' fields but not for 'hidden' fields.

This simple patch blocks the viewing of hidden fields.

This issue applies to 4.7 and 5.0

Cheers, Danny van der Weide

Comments

dvdweide’s picture

Status: Reviewed & tested by the community » Needs review

I heard i shouldn't put my own patches on 'ready to commit'.

Danny

ChrisKennedy’s picture

Status: Needs review » Needs work

You have a typo in your comment and it isn't a cvs patch per http://drupal.org/patch

tostinni’s picture

Priority: Critical » Normal
StatusFileSize
new830 bytes

A more simple version of this patch

dvdweide’s picture

Hi Tostinni,

Your patch makes hidden fields browsable by users with 'administer users' permission.

But hidden fields are not browsable because they are stored in the 'users' table and not in the 'profile_values' table like all the other profile values.
This means that hidden fields cannot be browsable, and thus my patch is correct!

Furthermore, i think that the priority should remain 'critical' because of possible stale values that are still in the 'profile_values' table when a profile field has been changed to 'hidden' in a later stadium. This is a potential security problem.

I don't know if i have to resubmit my patch to override yours, but first i'll wait for your reaction/opinion.

Cheers, Danny

tostinni’s picture

But hidden fields are not browsable because they are stored in the 'users' table and not in the 'profile_values' table like all the other profile values.

Hum where did you get that ?
I try to save some hidden fields and they all went to profile_values table, can you describe this a little more ?

dvdweide’s picture

Priority: Normal » Critical

Please excuse my ignorance, Tostinni!
It seems that this code has changed somewhere between 4.7 an 5.x, and i didn't notice.....

So, your patch is for the HEAD/5.x branches, while mine is for 4.7. Great!
I've looked at yours, and although i didn't try it out, my eyes are sure it will work just fine.

Il still don't agree on the priority change, though.
This is a critical issue, because anyone can browse hidden profile fields, and it's even worse on 5.x than on 4.7, since hidden fields have become actually browsable.
So, i feel i have to change is back again. Sorry! ;-)

Cheers, Danny

drumm’s picture

Status: Needs work » Needs review
drumm’s picture

Version: 5.x-dev » 6.x-dev
Status: Needs review » Reviewed & tested by the community

Committed to 5.x.

Needs to go in 6.x.

stevenpatz’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new800 bytes

A patch for 6.x-dev

gábor hojtsy’s picture

Status: Needs review » Fixed

Also committed to Drupal 6.

Anonymous’s picture

Status: Fixed » Closed (fixed)