mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-24 09:03:15 -05:00
[GH-ISSUE #921] bitwarden_rs sometimes sends invalid responses ("Data": null) #13442
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @champtar on GitHub (Mar 22, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/921
Subject of the issue
bitwarden_rs in some cases sends invalid responses where "Data" is null, breaking Android sync
Your environment
Steps to reproduce
Not sure exactly, maybe doing a clone of an item using the Firefox extension, my wife ended up with broken sync on the Android App
Expected behaviour
Everything works
Actual behaviour
And here the same item when using the webui json export
Additional information:
How to reproduce the bug might be fixed by
2ee07ea1d8, but we might need to clean the databaseThis was also reported at https://github.com/bitwarden/mobile/issues/790, the closing message is that Data should not be null
@deeztek commented on GitHub (Mar 30, 2020):
Try this.
Exported my vault to .json. Then I did a search for the following:
"username": null,
"password": null
Then in the web browser, I located the particular entry and deleted it.
Not sure which entry it was, but after deleting 27 entries, the android app started syncing again.
@dani-garcia commented on GitHub (Mar 30, 2020):
This should be solved with
adf47827c9. Hopefully that also fixes your issue @deeztek, without having to modify the export manually.@deeztek commented on GitHub (Mar 30, 2020):
I'm glad there is a fix, too late for me since I already did the export but hopefully this will help other people.
@alex-martel commented on GitHub (Mar 30, 2020):
@dani-garcia thanks for the fix!
I have a question though, with the fix then it will sync empty username/password, so users wont be able to know until they arrive at the moment they try to login to one of the faulty service. Should it be logged, or told somehow?
@dani-garcia commented on GitHub (Mar 30, 2020):
There isn't much we can show the user, the data we return is encrpyted so we can't, say, modify the name to append (Corrupted) to it or something. We can log an entry in the console but that's easily missed unless you are looking at it.
@dani-garcia commented on GitHub (Apr 8, 2020):
Fixed already so closing.
@jjlin commented on GitHub (Apr 11, 2020):
I looked into this issue a bit more, and it's easy to reproduce. But to summarize:
adf47827), mobile sync should be successful despite the presence of any empty cloned entries, and you can delete such entries whenever you get around to it.To reproduce:
bitwardenrs/server:1.14image (which doesn't have the2ee07ea1cloning fix).Organization id not providederror, but a partially-cloned empty/broken entry still ends up getting created.Syncing failed.For reference, here's the vault export and corresponding cipher entries:
Vault export
Cipher entries
@dani-garcia commented on GitHub (Apr 11, 2020):
Okay so I've tried debugging this and I can get it to reproduce, but once I upgrade to 1.14.1 with the fix in
adf4782, it starts working in the phone apps for me again. The data field is empty in the broken cipher, and that fails to deserialize for me with the errorErr(Error("EOF while parsing a value", line: 1, column: 0)), so it gets the value from the unwrap, which should be a valid value.You can check with
println!("{:?}", serde_json::from_str::<Value>(&self.data));@jjlin commented on GitHub (Apr 11, 2020):
1.14.1 doesn't contain
adf4782though, or do you mean you created a build of 1.14.1 with that commit cherry-picked? After I did the initial reproduction with 1.14 here, I switched to the 1.14.1 tag with the same data files, and the sync still failed for me. I'll look more into it when I get a chance.@dani-garcia commented on GitHub (Apr 11, 2020):
Ah you are right, I just checked out that commit specifically, thought the 1.14.1 tag was after it, not before.
Yes, then version 1.14.1 shouldn't work but any commit after
adf4782should work. If you can confirm I'll tag a new version 1.14.2.@jjlin commented on GitHub (Apr 11, 2020):
After 1.14.1 didn't work, I pulled and switched to the
latesttag, which also didn't work. At that time, I verified that the/api/syncresponse was still returning"Data": null, which was why I saidadf4782wasn't working. But maybe I'm somehow mistaken, I'll check again later.@jjlin commented on GitHub (Apr 11, 2020):
I tried the test again, and it worked this time with
latest. I also added some print statements and it looks like everything is working as expected. Maybe it was a caching issue, or I was just up too late. Sorry about that, I'll update the previous comment to say it's fixed in 1.14.2.@jjlin commented on GitHub (Jul 12, 2020):
There's now a related fix upstream in the mobile client (bitwarden/mobile#1008), though I'm not sure that it handles this issue completely.