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

Fix iOS sync by converting field types to int #5081

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

BlackDex
Copy link
Collaborator

It seems the iOS clients are not able to handle the type key within the fields array when they are of the type string.
All other clients seem to handle this just fine though.

This PR fixes this by validating it is a number, if this is not the case, try to convert the string to a number, or return the default of 1.
1 is used as this is the type hidden and should prevent accidental data disclosure.

Fixes #5069

Possibly Fixes #5016
Possibly Fixes #5002

It seems the iOS clients are not able to handle the `type` key within the `fields` array when they are of the type string.
All other clients seem to handle this just fine though.

This PR fixes this by validating it is a number, if this is not the case, try to convert the string to a number, or return the default of `1`.
`1` is used as this is the type `hidden` and should prevent accidental data disclosure.

Fixes dani-garcia#5069

Possibly Fixes dani-garcia#5016
Possibly Fixes dani-garcia#5002

Signed-off-by: BlackDex <[email protected]>
@dani-garcia dani-garcia merged commit 49c5dec into dani-garcia:main Oct 13, 2024
5 checks passed
@BlackDex BlackDex deleted the fix-ios-sync-issue branch October 15, 2024 15:29
@Gerardv514
Copy link

Curious if Bitwarden fixes their iOS client to properly handle this, would this fix then be pulled from the VW code since it would (or might) no longer be needed?

Im sure this occurs everywhere, but how/when/where would one know to go back to an area in the code to remove things that are no longer needed? Like code clean up

@BlackDex
Copy link
Collaborator Author

I think not. Types are fixed in json, and Bitwarden was very flexible with this, same like the camelCase and PasalCase. The new clients are more strict, and need to have less checks of course, but this does mean it could case issues if the server doesn't format the data correctly.

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