Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CiviCRM Export data overrides security #2

Open
chumkui opened this issue Jan 20, 2022 · 5 comments
Open

CiviCRM Export data overrides security #2

chumkui opened this issue Jan 20, 2022 · 5 comments

Comments

@chumkui
Copy link

chumkui commented Jan 20, 2022

Hi Alain - we have been using the extension for a while now (it's great, thank you) but by chance noticed an issue today when we did an export on staff members.

I think this is also a general Civi issue in term of exporting data, but raising it with you as it particualrly affects additional privacy levels.

If you add notes that are not supposed to be visible to others - either your additional privacy levels or even just 'Author only', you can simply do an Export contacts, choose all primary fields and you get to see the notes.

From my testing, as long as someone has 'View only' on a contact record, they can export to see hidden notes that would be hidden for that person via the UI - not a situation we want. I might just be missing the obvious of course...!

I am going to try and lockdown the export for the moment, I think there is a way to hide it on the menu with an extension until I can be sure we are secure.

@AlainBenbassat
Copy link
Owner

Thanks @chumkui for reporting this.
Maybe by implementing the hook hook_civicrm_export the private notes can be hidden.
I am happy to accept your pull request with this change. Otherwise I'll implement it later this month.

@chumkui
Copy link
Author

chumkui commented Jan 25, 2022

Thanks Alain - you probably would not want me touching code :-)

@chumkui
Copy link
Author

chumkui commented Jan 26, 2022

OK Alain - you shamed me into looking at this last night :-) As a stop gap I created my very first Civi extension. All it does is remove the notes column from any final export by using an unset on the two arrays that hold the column and header row. Ugly but effective...

I did take a look through the debugger at how the export processor builds up everything to create the table that I can hook into, but I lost the will to live.... I cannot get my head around how I only remove the notes that have a privacy of X, but its a bit beyond me at the moment. I do not develop on a daily basis and so this is challenge for me. Throw me a hint and I'll take a look!

Thanks again for the hook hint, I've at least solved the immediate issue and from an information leakage/privacy point of view, it is quite a big step forward. Many thanks again.

@mlutfy
Copy link

mlutfy commented Jul 3, 2023

I think it's a core bug, not specific to this extension, so I reported it to the security team.

I wrote a slightly different extension that takes inspiration from this one, but my client had very specific requirements, so I wrote this:

@chumkui
Copy link
Author

chumkui commented Nov 8, 2023

Many thanks mlutty - I'll take a look. They have deprecated hook_civicrm_notePrivacy, so will need to revisit a couple of things I've done in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants