pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.56k stars 659 forks source link

stored passwords cannot be decoded #8069

Closed ccurvey closed 2 days ago

ccurvey commented 1 month ago

Please note that security bugs or issues should be reported to security@pgadmin.org.

Saved password cannot be decoded after restarting PgAdmin

To Reproduce

Steps to reproduce the behavior:

  1. Register a server. Ensure that the password is saved. Confirm that you can connect to the server
  2. Quit PgAdmin
  3. Start PgAdmin
  4. Click on the server in the tree pane
  5. Get error message saying "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 0: invalid start byte"

Expected behavior

You should be connected to the server

Error message

"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 0: invalid start byte"

(Note that it is always a UnicodeDecodeError, although the byte position may vary.)

Screenshots

image

Desktop (please complete the following information):

Additional context

I thought I had filed this bug report before, but I can't find it anywhere.

yogeshmahajan-1903 commented 1 month ago

@ccurvey Can you please Clear save password from context menu of the server and try saving it again.

ccurvey commented 1 month ago

No joy. I tried clearing and re-saving. I tried deleting the server connection and re-adding. Everything works until I restart the program, then I get the decode error.

This is an old machine, it has run many versions of PgAdmin in the past. I even tried purging PgAdmin from the system and re-installing...but I was very surprised to see my servers available after I re-installed the software.

I can try removing and re-installing again. Maybe there's some directory or file that I need to manually delete between the removal and installation.

akshay-joshi commented 3 weeks ago

@ccurvey

Can you please register a new server and try to store the password? Do you have any non-ASCII characters in the password?

We need to reproduce this issue.

ccurvey commented 3 weeks ago

No joy

  1. Create new server connection. Ensure we want to save the password. Save the connection. System connects successfully
  2. Disconnect server
  3. Reconnect server. System connects successfully
  4. Close PgAdmin4
  5. Open PgAdmin4.
  6. Click on new server...get "Failed to decrypt the saved password. Error: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte"

This system is very old, and it has run many versions of PgAdmin...maybe somewhere along the line there's something about the encoding that's weird?

If you can tell me where to find the stored passwords, maybe I can open that up and see what's in there

yogeshmahajan-1903 commented 2 weeks ago

@ccurvey Can you please list out me the entries in password store(or secret storage application in your machine)?

ccurvey commented 2 weeks ago

I'd be happy to! Where should I look?

adityatoshniwal commented 1 week ago

I'd be happy to! Where should I look?

Hi @ccurvey Can you please check the app PasswordStore on your system?

ccurvey commented 2 days ago

I was issued a new laptop, and pgadmin4 is working flawlessly on that, so I guess the problem was due to six or seven years of software upgrades leaving the machine in a weird state.