bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.17k stars 1.23k forks source link

SecureSafe: Import Fail #10786

Open Diiieeegooo opened 1 month ago

Diiieeegooo commented 1 month ago

Steps To Reproduce

  1. Go to 'Datei, Datei Import '
  2. Scroll down to 'Secure save' in Dateiformat
  3. choose your export from Secure save with comma delimeter
  4. Click on Datei Importieren 6: you will get: Importfail: Die Daten sind nicht richtig formatiert. Kontrolliere bitte deine Import-Datei und versuche es erneut.

The Headline of the secure safe doc is "/Titel/,/Benutzername/,/Passwort/,/URL/,/Kommentar/

Expected Result

Import my passwords from secure safe

Actual Result

Error: Die Daten sind nicht richtig formatiert. Kontrolliere bitte deine Import-Datei und versuche es erneut.

Screenshots or Videos

No response

Additional Context

No response

Operating System

Windows

Operating System Version

windows 11

Installation method

Direct Download (from bitwarden.com)

Build Version

newest one

Issue Tracking Info

djsmith85 commented 1 month ago

Hi @Diiieeegooo and thank you for your report.

Could you please post your column headers from the exported file (from SecureSafe). The current importer expects the following column headers: Title,Username,Password,URL,Comment

Kind regards, Daniel

Diiieeegooo commented 1 month ago

Hi @Diiieeegooo and thank you for your report.

Could you please post your column headers from the exported file (from SecureSafe). The current importer expects the following column headers: Title,Username,Password,URL,Comment

Kind regards, Daniel

The Headline is like this but in germann

djsmith85 commented 1 month ago

Hi @Diiieeegooo and thank you for your report. Could you please post your column headers from the exported file (from SecureSafe). The current importer expects the following column headers: Title,Username,Password,URL,Comment Kind regards, Daniel

The Headline is like this but in germann

Thank you @Diiieeegooo for reporting back. To continue with you import please adjust the headers to the ones I mentioned.

Just for completeness would you mind posting the German headers here?

I have seen a similar report where the headers were exported in French.

Easiest fix will be to add a quick header replacement within the SecureSafe CSV importer. Marking this as good first issue.

macronym commented 1 month ago

Hey @djsmith85 I am new to open-source contributions but I think I may be able to solve this issue. Could I be assigned?

djsmith85 commented 1 month ago

Hi @macronym ,

Thank you for offering your help with this. Github issues, don't get assigned, but feel free to open a Pull Request with your changes and link to this issue.

Please have a look at our Contribution Guidelines, these will help you with getting your environment set up and offer further information in regards to contributing.

Kind regards, Daniel

djsmith85 commented 1 month ago

Here are the French columns headers provided by another user: "Titre","Nom d'utilisateur","Mot de passe","URL","Commentaire"

djsmith85 commented 1 month ago

The SecureSafe-CSV importer can be found here: https://github.com/bitwarden/clients/blob/main/libs/importer/src/importers/securesafe-csv-importer.ts and the unit tests are located under https://github.com/bitwarden/clients/blob/main/libs/importer/spec/securesafe-csv-importer.spec.ts

macronym commented 1 month ago

Thank you for the tips! I claim this issue and will begin working on it. I believe I have gotten the development environment working.

tuhriel commented 3 weeks ago

I had the same issue recently and just found this issue while I planned to create a new one. The PR will probably solve the issue, but what I saw in my securesafe export is that the URL data contains additional slashes / probably to escape the slashes within the URLs:

"/Gmail/","/test@gmail.com/","/test","/https:////gmail.com/","comment/";

As far as I could see, the PR doesn't take that into account

I created a small python script to map the securesafe data to the default bitwarden csv-format. The csv module of python allows to set an escapechar which I defined as /. This cleaned the input completely and I just had to map it to the correct fields for the bitwarden format.

Not sure if the papaparse module of typescript has a similar function, that might help here

macronym commented 3 weeks ago

@tuhriel I did consider that in my solution, Bitwarden seems to parse it correctly when there are four slashes in the URL, because in the app it shows only 2.