dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
38.34k stars 1.86k forks source link

Import (1pif) into organization broken #908

Closed paradeiser closed 4 years ago

paradeiser commented 4 years ago

Since the latest update to 2.13.1 Bitwarden crashes when trying to import a .1pif file.

Steps to reproduce

When using the Import page in the web UI, I select .1pif and upload the file. After a few seconds bitwarden reloads with the login page, stating an unexpected failiure and I have to relogin.

Before the update I frequently used this option without issues.

Is it just me? best regards

jjlin commented 4 years ago

It would help if you could try your import on vault.bitwarden.com to determine whether the issue originates upstream.

paradeiser commented 4 years ago

this is bitwarden_rs for selfhosted instances. so I dont have access to vault.bitwarden.com

jjlin commented 4 years ago

Most bitwarden_rs users don't use 1Password, so if you're interested in making progress on this issue, it would be helpful if you tried your import on vault.bitwarden.com, as the bitwarden_rs web vault is almost identical to the upstream web vault, and I don't know of any reason 1Password imports would be broken on bitwarden_rs specifically. If your issue also happens on the upstream vault, then an issue should be raised there instead.

paradeiser commented 4 years ago

I tried to trace it down:

  1. I cleared the docker and used the latest release to rebuild
  2. Import works in vault.bitwarden.com AND bitwarden_rs when importing to "my vault"
  3. Import works in vault.bitwarden.com when importing into an organization
  4. Import FAILS in bitwarden_rs when importing into an organization!

hope that helps to trace down the bug. best regards

BlackDex commented 4 years ago

@paradeiser are you able to create a test export for us? I don't have 1Password, and i think most of developers here do not have that, since they use bitwarden ;).

Also, i noticed at the official documentation that there are two different versions/ways to export/import it into bitwarden: https://help.bitwarden.com/article/import-from-1password/

But in any case, an example export would be cool to have so that we can test it.

paradeiser commented 4 years ago

sure, here you go: 1Password_TestExportFile.1pif.zip (zipped coz otherwise not supported to upload here)

BlackDex commented 4 years ago

Great! Thx. Lets see what we can find.

kidfrostbite commented 4 years ago

Fwiw I'm having the same issue and can supply more info and logs if needed. The import also fails for me with json data. I even tried a most basic test of creating a new org, making one test entry in the org's vault, exporting that as bitwarden .json and the same failure occurs. Relevant log entries are:

2020-03-17 18:50:19][auth][ERROR] Unauthorized Error: The current user isn’t member of the organization [2020-03-17 18:50:19][response][INFO] POST /api/ciphers/import-organization?<query…> (post_org_import) => 401 Unauthorized

I've also verified that everything works as expected on vault.bitwarden.com.

BlackDex commented 4 years ago

I can verify this also. Now to find out why.

karrots commented 4 years ago

Seeing this same issue with a KeePass XML import. It has a fair amount of folders which would be imported as collections. A few of the collections already exist.

BlackDex commented 4 years ago

@karrots, this is with all imports in to the organization. Not specifically linked to a specific kind of import

karrots commented 4 years ago

ok cool. Is there a build of the dockers that follows master? I'd love to test this fix.

BlackDex commented 4 years ago

The bitwardenrs/server:latest is the one to look for. It does take a while for them to build, so we all have to be a bit patient unfortunately. The fix will be in the version with this hash part ff19fb.

karrots commented 4 years ago

This commit fixed the problem for me.

kidfrostbite commented 4 years ago

Fixed for me as well.

dani-garcia commented 4 years ago

Great! The latest release 1.14.1 contains this fix, it'll take some time to build the docker images still.