View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
20902Bug reportsCentral participant databasepublic2026-11-26 17:13
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status feedbackResolutionopen 
Product Version7.11.x 
Summary20902: CPDB: overwriting attributes of an existing central participant from a survey copies the raw value, encryption settings are igno
Description

When survey participants are added to the central participant database (CPDB) and a matching central participant already exists, the "overwrite" options copy the attribute values with Participant::updateAttributeValueToken().

This function copies the raw value of the survey participant column to participant_attribute: the value is not decrypted with the survey settings, and not encrypted with the settings of the destination CPDB attribute.

  • Survey attribute encrypted, CPDB attribute not encrypted: the CPDB attribute contains the encrypted string instead of the plain value.
  • Survey attribute not encrypted, CPDB attribute encrypted: the plain value is stored where an encrypted value is expected (stored in clear, and it can not be decrypted when it is read).
Steps To Reproduce

Steps to reproduce

  1. Create a CPDB attribute "Department", not encrypted.
  2. Create a survey with a survey participant table and a participant attribute (attribute_1), encrypted.
  3. Add a survey participant with a value in attribute_1, and share it with the CPDB (the central participant is created).
  4. Change the value of attribute_1 for this survey participant.
  5. Add the survey participant to the CPDB again: map attribute_1 to "Department", check the option to overwrite the existing values.
  6. Look at "Department" for this central participant.

Expected result

"Department" contains the new plain value.

Actual result

"Department" contains the encrypted string of the survey attribute.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)7.11.0
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant
Git branch / Pull Request URLN/A

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2026-11-26 16:34

developer   ~87974

Possible fix, like the CSV import of the CPDB (ParticipantsAction::actionImportCSV): read the survey participant with TokenDynamic and decrypt() it, then write the value with new ParticipantAttribute() + encrypt() + ParticipantAttribute::updateParticipantAttributeValue(). encrypt() applies the "encrypted" setting of the CPDB attribute and CPDB_encryption_method.

tibor.pacalat

tibor.pacalat

2026-11-26 17:04

administrator   ~87978

Hmm, I am not sure if this is supposed to work like that. I did the same scenario, but I have set the attribute as encrypted in the CPDB and this worked.
I think you either need to have the attribute plain or encrypted on both sides.

DenisChenu

DenisChenu

2026-11-26 17:13

developer   ~87979

Oh fuck

Wrong decryption key! Decryption key has changed since this data were last saved, so data can't be decrypted. Please consult our manual at https://www.limesurvey.org/manual/Data_encryption#Errors.

I check tomorrow

Issue History

Date Modified Username Field Change
2026-11-26 16:29 DenisChenu New Issue
2026-11-26 16:34 DenisChenu Note Added: 87974
2026-11-26 16:34 DenisChenu Bug heat 0 => 2
2026-11-26 17:04 tibor.pacalat Note Added: 87978
2026-11-26 17:04 tibor.pacalat Bug heat 2 => 4
2026-11-26 17:05 tibor.pacalat Assigned To => DenisChenu
2026-11-26 17:05 tibor.pacalat Status new => feedback
2026-11-26 17:13 DenisChenu Note Added: 87979