fix: allow empty field titles in decrypted responses#86
Merged
Conversation
karrui
approved these changes
Dec 16, 2022
| expect(decrypted).toHaveProperty('responses', plaintextMultiLang) | ||
| }) | ||
|
|
||
| it('should be able to encrypt and decrypt submissions with empty field titles from 2022-11-14 end-to-end successfully', () => { |
Contributor
There was a problem hiding this comment.
Don't need so specific test la haha, just say can decrypt empty strings
Contributor
Author
There was a problem hiding this comment.
hahah oops i follow format only xD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On 14 Nov 2022, a bug was identified in FormSG that allowed admins to create fields with empty field titles via the UI. As an unintended consequence, form responses to such storage mode forms became undecryptable. However, this was not caught to be an issue at the time, and thus was not communicated to form admins. This issue only came to light on 14 Dec 2022, when an admin of an affected form ended up not being able to decrypt form responses.
Solution
This PR changes the decrypted response validator to check for the type of the field title, in order to allow for empty strings. It also adds a test for this in the spec.